Replaces find(:first) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10930 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -216,12 +216,12 @@ module ActiveRecord #:nodoc:
|
||||
has_many :versions, version_association_options do
|
||||
# finds earliest version of this record
|
||||
def earliest
|
||||
@earliest ||= find(:first, :order => 'version')
|
||||
@earliest ||= order('version').first
|
||||
end
|
||||
|
||||
# find latest version of this record
|
||||
def latest
|
||||
@latest ||= find(:first, :order => 'version desc')
|
||||
@latest ||= order('version desc').first
|
||||
end
|
||||
end
|
||||
before_save :set_new_version
|
||||
|
||||
Reference in New Issue
Block a user