mirror of
https://github.com/redmine/redmine.git
synced 2025-11-16 02:06:04 +01:00
Merged r15950 (#24348).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16001 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -469,9 +469,10 @@ module ActiveRecord #:nodoc:
|
|||||||
|
|
||||||
# Finds versions of a specific model. Takes an options hash like <tt>find</tt>
|
# Finds versions of a specific model. Takes an options hash like <tt>find</tt>
|
||||||
def find_versions(id, options = {})
|
def find_versions(id, options = {})
|
||||||
versioned_class.all({
|
versioned_class.
|
||||||
:conditions => ["#{versioned_foreign_key} = ?", id],
|
where(options[:conditions] || {versioned_foreign_key => id}).
|
||||||
:order => 'version' }.merge(options))
|
limit(options[:limit]).
|
||||||
|
order('version')
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns an array of columns that are versioned. See non_versioned_columns
|
# Returns an array of columns that are versioned. See non_versioned_columns
|
||||||
|
|||||||
Reference in New Issue
Block a user