diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-11-18 07:19:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-11-18 07:19:13 +0000 |
commit | 2b70d977052af13f21e0eb7a719d98a74e210043 (patch) | |
tree | 4562ce3475656ef7fb395cae7172b0d7a04292c2 /lib/plugins | |
parent | b85dc8b35c93af0a0cbcca156c479f20e25af186 (diff) | |
download | redmine-2b70d977052af13f21e0eb7a719d98a74e210043.tar.gz redmine-2b70d977052af13f21e0eb7a719d98a74e210043.zip |
acts_as_versioned use old style (Rails 2.x) of method call for #all (#24348).
git-svn-id: http://svn.redmine.org/redmine/trunk@15950 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb b/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb index ffd344293..bccb4068d 100644 --- a/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb +++ b/lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb @@ -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 |