aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/collection_association.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-03-13 11:40:35 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-03-13 11:40:35 -0700
commitd92ae6ccca3bcfd73546d612efaea011270bd270 (patch)
tree5eaf6b2449f29cc6050e802e1ca1491f7eb13537 /activerecord/lib/active_record/associations/collection_association.rb
parente88da370f190cabd1e9750c5b3531735950ab415 (diff)
downloadrails-d92ae6ccca3bcfd73546d612efaea011270bd270.tar.gz
rails-d92ae6ccca3bcfd73546d612efaea011270bd270.tar.bz2
rails-d92ae6ccca3bcfd73546d612efaea011270bd270.zip
passing an ActiveRecord object to `exists?` is deprecated.
Pass the id of the object to the method by calling `.id` on the AR object.
Diffstat (limited to 'activerecord/lib/active_record/associations/collection_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index 9a2900843e..ff0fbe932b 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -370,7 +370,7 @@ module ActiveRecord
if record.new_record?
include_in_memory?(record)
else
- loaded? ? target.include?(record) : scope.exists?(record)
+ loaded? ? target.include?(record) : scope.exists?(record.id)
end
else
false