ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Bug in Versioned#versions_count (acts_as_versioned) (Bug #152)

Added by Felix Schäfer at 2011-02-06 05:37 pm. Updated at 2011-08-21 01:29 pm.

Status:Declined Start date:2011-02-06
Priority:Normal Due date:
Assignee:- % Done:


Target version:-
Remote issue URL: Affected version:


This line: source:/vendor/plugins/acts_as_versioned/lib/acts_as_versioned.rb#L270 obviously only works when the local variable page is defined.

Related issues

related to Feature #123: Review and Merge acts_as_journalized Closed 2011-02-02


Updated by Felix Schäfer at 2011-02-10 09:34 pm

(This would also be obsolete after #123 is done)

Updated by Felix Schäfer at 2011-02-22 06:36 pm

This should fix it, I wasn't able to run the tests of the plugin though (but that's an independent problem from this one here…):

 1diff --git a/vendor/plugins/acts_as_versioned/lib/acts_as_versioned.rb b/vendor/plugins/acts_as_versioned/lib/acts_as_versioned.rb
 2index bba10c4..6be26d1 100644
 3--- a/vendor/plugins/acts_as_versioned/lib/acts_as_versioned.rb
 4+++ b/vendor/plugins/acts_as_versioned/lib/acts_as_versioned.rb
 5@@ -267,7 +267,7 @@ module ActiveRecord #:nodoc:
 6             end
 8             def versions_count
 9-              page.version
10+              self.class.count(:conditions => ["#{original_class.versioned_foreign_key} = ?", self.send(original_class.versioned_foreign_key)])
11             end
12           end
  • Status changed from Open to Ready for review

Updated by Holger Just at 2011-08-21 01:29 pm

I think this is obsolete now after #123 got merged.

  • Status changed from Ready for review to Declined

Also available in: Atom PDF