aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorFrederick Cheung <frederick.cheung@gmail.com>2008-12-26 23:26:37 +0000
committerFrederick Cheung <frederick.cheung@gmail.com>2008-12-26 23:26:37 +0000
commitf9cab0e503a4721c9d0369f89bb85c6e658f778c (patch)
tree8d0c579bd0f75b824779b3a5ba76c3f39af157a6 /activerecord/lib
parent7db1704068b86fb2212388b14b4963526bacfa5d (diff)
downloadrails-f9cab0e503a4721c9d0369f89bb85c6e658f778c.tar.gz
rails-f9cab0e503a4721c9d0369f89bb85c6e658f778c.tar.bz2
rails-f9cab0e503a4721c9d0369f89bb85c6e658f778c.zip
Fix :include of has_one with :primary_key option
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/association_preload.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb
index 195d2fb4f8..e4ab69aa1b 100644
--- a/activerecord/lib/active_record/association_preload.rb
+++ b/activerecord/lib/active_record/association_preload.rb
@@ -195,7 +195,7 @@ module ActiveRecord
def preload_has_one_association(records, reflection, preload_options={})
return if records.first.send("loaded_#{reflection.name}?")
- id_to_record_map, ids = construct_id_map(records)
+ id_to_record_map, ids = construct_id_map(records, reflection.options[:primary_key])
options = reflection.options
records.each {|record| record.send("set_#{reflection.name}_target", nil)}
if options[:through]