]> source.dussan.org Git - redmine.git/commitdiff
acts_as_versioned use old style (Rails 2.x) of method call for #all (#24348).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 18 Nov 2016 07:19:13 +0000 (07:19 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 18 Nov 2016 07:19:13 +0000 (07:19 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@15950 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb

index ffd34429329b497d1481fcc646ceccc3e9a2b4cb..bccb4068d90bf77c3c80d595b4136edd35724a19 100644 (file)
@@ -469,9 +469,10 @@ module ActiveRecord #:nodoc:
 
           # Finds versions of a specific model.  Takes an options hash like <tt>find</tt>
           def find_versions(id, options = {})
-            versioned_class.all({
-              :conditions => ["#{versioned_foreign_key} = ?", id],
-              :order      => 'version' }.merge(options))
+            versioned_class.
+                where(options[:conditions] || {versioned_foreign_key => id}).
+                limit(options[:limit]).
+                order('version')
           end
 
           # Returns an array of columns that are versioned.  See non_versioned_columns