aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-03-26 00:02:40 +0100
committerXavier Noria <fxn@hashref.com>2011-03-26 00:02:40 +0100
commit9d9b873b9501f5fc90c0b6a4a550c5e29fc742a5 (patch)
treeec5e8fdea5c8ec024dcc336e967f4e55e37c2589 /activerecord/lib/active_record/relation
parent6383f6704f5eca0d9094840fae2685f361b0e752 (diff)
downloadrails-9d9b873b9501f5fc90c0b6a4a550c5e29fc742a5.tar.gz
rails-9d9b873b9501f5fc90c0b6a4a550c5e29fc742a5.tar.bz2
rails-9d9b873b9501f5fc90c0b6a4a550c5e29fc742a5.zip
removes unnecessary selfs, and mentions that first! and last! take no arguments in their API docs
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb10
1 files changed, 6 insertions, 4 deletions
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 <tt>ActiveRecord::RecordNotFound</tt> if no record
+ # is found. Note that <tt>first!</tt> accepts no arguments.
def first!
- self.first or raise RecordNotFound
+ first or raise RecordNotFound
end
# A convenience wrapper for <tt>find(:last, *args)</tt>. 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 <tt>ActiveRecord::RecordNotFound</tt> if no record
+ # is found. Note that <tt>last!</tt> accepts no arguments.
def last!
- self.last or raise RecordNotFound
+ last or raise RecordNotFound
end
# A convenience wrapper for <tt>find(:all, *args)</tt>. You can pass in all the