From 04cda1848cb847c2bdad0bfc12160dc8d5547775 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Tue, 2 Apr 2013 15:09:15 -0400 Subject: Prefer find_by over dynamic finders in rdoc --- activerecord/lib/active_record/associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations.rb') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 4fd817bd8c..3c92e379f1 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -988,7 +988,7 @@ module ActiveRecord # associated objects themselves. So with +has_and_belongs_to_many+ and +has_many+ # :through, the join records will be deleted, but the associated records won't. # - # This makes sense if you think about it: if you were to call post.tags.delete(Tag.find_by_name('food')) + # This makes sense if you think about it: if you were to call post.tags.delete(Tag.find_by(name: 'food')) # you would want the 'food' tag to be unlinked from the post, rather than for the tag itself # to be removed from the database. # -- cgit v1.2.3