summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-11-26 09:02:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-11-26 09:02:52 +0000
commitc97a9488a2a659eb60a5c4406613ad068c1273f7 (patch)
treec41d249c5175d0c27dd847f6a244ee69361bdb43 /lib/plugins
parent35dff9428f726cc40dfc0b4432a80f145bb5a619 (diff)
downloadredmine-c97a9488a2a659eb60a5c4406613ad068c1273f7.tar.gz
redmine-c97a9488a2a659eb60a5c4406613ad068c1273f7.zip
Merged r15950 (#24348).
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@16002 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