diff options
| author | Jim Van Fleet <bigfleet@administrators-computer.local> | 2008-04-30 12:58:25 -0400 |
|---|---|---|
| committer | Jim Van Fleet <bigfleet@administrators-computer.local> | 2008-04-30 12:58:25 -0400 |
| commit | 177276643fce38c752004fd81614b8af5ac1587f (patch) | |
| tree | 06db6e50d8f3264a0b7af0cd9776636d7121a980 | |
| parent | 4c845dc43e7dd325b6dba1e047b857e42f211f0e (diff) | |
Prevents conflicting order by clauses, e.g. "ORDER BY version desc, version"
| -rw-r--r-- | lib/acts_as_versioned.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/acts_as_versioned.rb b/lib/acts_as_versioned.rb index f6a83b39a..253c0f019 100644 --- a/lib/acts_as_versioned.rb +++ b/lib/acts_as_versioned.rb @@ -200,7 +200,6 @@ module ActiveRecord #:nodoc: self.version_association_options = { :class_name => "#{self.to_s}::#{versioned_class_name}", :foreign_key => versioned_foreign_key, - :order => 'version', :dependent => :delete_all }.merge(options[:association_options] || {}) @@ -217,7 +216,7 @@ module ActiveRecord #:nodoc: has_many :versions, version_association_options do # finds earliest version of this record def earliest - @earliest ||= find(:first) + @earliest ||= find(:first, :order => 'version') end # find latest version of this record |
