1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

preloaded_records no longer includes nil since #35496

This commit is contained in:
Ryuta Kamizono 2019-04-05 11:13:12 +09:00
parent bbd8dd9cca
commit a11ca2ff76

View file

@ -150,7 +150,6 @@ module ActiveRecord
def grouped_records(association, records, polymorphic_parent) def grouped_records(association, records, polymorphic_parent)
h = {} h = {}
records.each do |record| records.each do |record|
next unless record
reflection = record.class._reflect_on_association(association) reflection = record.class._reflect_on_association(association)
next if polymorphic_parent && !reflection || !record.association(association).klass next if polymorphic_parent && !reflection || !record.association(association).klass
(h[reflection] ||= []) << record (h[reflection] ||= []) << record