From 7baecc48028e2d0cb57936ad10b9102ed129c9f9 Mon Sep 17 00:00:00 2001 From: robertomiranda Date: Fri, 18 Jan 2013 07:56:05 -0500 Subject: User Rails 4 find_by --- 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 16a46a59d1..232c0323e6 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -987,7 +987,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