aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/autosave_association.rb
diff options
context:
space:
mode:
authorSam Ruby <rubys@intertwingly.net>2013-04-02 15:09:15 -0400
committerSam Ruby <rubys@intertwingly.net>2013-04-02 15:09:15 -0400
commit04cda1848cb847c2bdad0bfc12160dc8d5547775 (patch)
treec0ce8e2c6c309b5e57ce67e9aee3c8eead6ec353 /activerecord/lib/active_record/autosave_association.rb
parent6871b2e6e00db64c4f5f7213e4d007479ed7f538 (diff)
downloadrails-04cda1848cb847c2bdad0bfc12160dc8d5547775.tar.gz
rails-04cda1848cb847c2bdad0bfc12160dc8d5547775.tar.bz2
rails-04cda1848cb847c2bdad0bfc12160dc8d5547775.zip
Prefer find_by over dynamic finders in rdoc
Diffstat (limited to 'activerecord/lib/active_record/autosave_association.rb')
-rw-r--r--activerecord/lib/active_record/autosave_association.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb
index 0df3e57947..44323ce9db 100644
--- a/activerecord/lib/active_record/autosave_association.rb
+++ b/activerecord/lib/active_record/autosave_association.rb
@@ -62,14 +62,14 @@ module ActiveRecord
# Note that the model is _not_ yet removed from the database:
#
# id = post.author.id
- # Author.find_by_id(id).nil? # => false
+ # Author.find_by(id: id).nil? # => false
#
# post.save
# post.reload.author # => nil
#
# Now it _is_ removed from the database:
#
- # Author.find_by_id(id).nil? # => true
+ # Author.find_by(id: id).nil? # => true
#
# === One-to-many Example
#
@@ -113,14 +113,14 @@ module ActiveRecord
# Note that the model is _not_ yet removed from the database:
#
# id = post.comments.last.id
- # Comment.find_by_id(id).nil? # => false
+ # Comment.find_by(id: id).nil? # => false
#
# post.save
# post.reload.comments.length # => 1
#
# Now it _is_ removed from the database:
#
- # Comment.find_by_id(id).nil? # => true
+ # Comment.find_by(id: id).nil? # => true
module AutosaveAssociation
extend ActiveSupport::Concern