From 5009b078875e596a2fba7827336f7548aa6e35ac Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Sat, 22 Jun 2013 12:15:42 +0200 Subject: Revert "Merge pull request #10901 from armstrjare/fix_query_null_foreign_key_on_new_record_collection_ids_reader" This reverts commit 6675d713186c270de1c4684bc1e56742ea2e19e1, reversing changes made to 919d1a19d5e7871d50c1531351fc3f736bad5d07. I missed to check the target branch and wrongly merged it into 3-2-stable directly. --- activerecord/lib/active_record/associations/collection_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index baddb9852f..65e882867e 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -43,7 +43,7 @@ module ActiveRecord # Implements the ids reader method, e.g. foo.item_ids for Foo.has_many :items def ids_reader - if owner.new_record? || loaded? || options[:finder_sql] + if loaded? || options[:finder_sql] load_target.map do |record| record.send(reflection.association_primary_key) end -- cgit v1.2.3