##// END OF EJS Templates
Merged r15950 (#24348)....
Jean-Philippe Lang -
r15619:7189fdbf0c8e
parent child
Show More
@@ -469,9 +469,10 module ActiveRecord #:nodoc:
469
469
470 # Finds versions of a specific model. Takes an options hash like <tt>find</tt>
470 # Finds versions of a specific model. Takes an options hash like <tt>find</tt>
471 def find_versions(id, options = {})
471 def find_versions(id, options = {})
472 versioned_class.all({
472 versioned_class.
473 :conditions => ["#{versioned_foreign_key} = ?", id],
473 where(options[:conditions] || {versioned_foreign_key => id}).
474 :order => 'version' }.merge(options))
474 limit(options[:limit]).
475 order('version')
475 end
476 end
476
477
477 # Returns an array of columns that are versioned. See non_versioned_columns
478 # Returns an array of columns that are versioned. See non_versioned_columns
General Comments 0
You need to be logged in to leave comments. Login now