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:
Jean-Philippe Lang
2012-12-03 20:55:04 +00:00
parent 738cf2e187
commit a7023dfa9b
3 changed files with 12 additions and 12 deletions
@@ -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