Project

General

Profile

Defect #24348 ยป 24348.patch

Roman Shipiev, 2016-11-14 14:14

View differences:

lib/plugins/acts_as_versioned/lib/acts_as_versioned.rb
469 469

  
470 470
          # Finds versions of a specific model.  Takes an options hash like <tt>find</tt>
471 471
          def find_versions(id, options = {})
472
            versioned_class.all({
473
              :conditions => ["#{versioned_foreign_key} = ?", id],
474
              :order      => 'version' }.merge(options))
472
            versioned_class.
473
                where(options[:conditions] || {versioned_foreign_key => id}).
474
                limit(options[:limit]).
475
                order('version')
475 476
          end
476 477

  
477 478
          # Returns an array of columns that are versioned.  See non_versioned_columns
    (1-1/1)