summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-11-26 09:02:26 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-11-26 09:02:26 +0000
commit7189fdbf0c8e163dae9ff85895a891d83c27289b (patch)
tree36c4feef66f1c1659121f6af7812fab44c78308e /lib/plugins
parent6ebb700db2f5d293661f6663e1de6f8ecdb07de2 (diff)
downloadredmine-7189fdbf0c8e163dae9ff85895a891d83c27289b.tar.gz
redmine-7189fdbf0c8e163dae9ff85895a891d83c27289b.zip
Merged r15950 (#24348).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16001 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb7
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