diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index d41a360821..563843f3cc 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -123,9 +123,10 @@ module ActiveRecord end end - # Same as #first but raises RecordNotFound if no record is returned + # Same as +first+ but raises ActiveRecord::RecordNotFound if no record + # is found. Note that first! accepts no arguments. def first! - self.first or raise RecordNotFound + first or raise RecordNotFound end # A convenience wrapper for find(:last, *args). You can pass in all the @@ -142,9 +143,10 @@ module ActiveRecord end end - # Same as #last but raises RecordNotFound if no record is returned + # Same as +last+ but raises ActiveRecord::RecordNotFound if no record + # is found. Note that last! accepts no arguments. def last! - self.last or raise RecordNotFound + last or raise RecordNotFound end # A convenience wrapper for find(:all, *args). You can pass in all the