diff options
Diffstat (limited to 'activerecord/lib/active_record/association_preload.rb')
-rw-r--r-- | activerecord/lib/active_record/association_preload.rb | 2 |
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 87b087bfea..9ef8ed15e8 100644 --- a/activerecord/lib/active_record/association_preload.rb +++ b/activerecord/lib/active_record/association_preload.rb @@ -21,7 +21,7 @@ module ActiveRecord preload_associations(records, parent, preload_options) reflection = reflections[parent] parents = records.map {|record| record.send(reflection.name)}.flatten - unless parents.empty? + unless parents.empty? || parents.first.nil? parents.first.class.preload_associations(parents, child) end end |