1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

removes unnecessary selfs, and mentions that first! and last! take no arguments in their API docs

This commit is contained in:
Xavier Noria 2011-03-26 00:02:40 +01:00
parent 6383f6704f
commit 9d9b873b95

View file

@ -123,9 +123,10 @@ module ActiveRecord
end end
end end
# Same as #first but raises RecordNotFound if no record is returned # Same as +first+ but raises <tt>ActiveRecord::RecordNotFound</tt> if no record
# is found. Note that <tt>first!</tt> accepts no arguments.
def first! def first!
self.first or raise RecordNotFound first or raise RecordNotFound
end end
# A convenience wrapper for <tt>find(:last, *args)</tt>. You can pass in all the # A convenience wrapper for <tt>find(:last, *args)</tt>. You can pass in all the
@ -142,9 +143,10 @@ module ActiveRecord
end end
end end
# Same as #last but raises RecordNotFound if no record is returned # Same as +last+ but raises <tt>ActiveRecord::RecordNotFound</tt> if no record
# is found. Note that <tt>last!</tt> accepts no arguments.
def last! def last!
self.last or raise RecordNotFound last or raise RecordNotFound
end end
# A convenience wrapper for <tt>find(:all, *args)</tt>. You can pass in all the # A convenience wrapper for <tt>find(:all, *args)</tt>. You can pass in all the