# File activerecord/lib/active_record/association_preload.rb, line 109def preload_one_association(records,association,preload_options={})class_to_reflection={}# Not all records have the same class, so group then preload# group on the reflection itself so that if various subclass share the same association then we do not split them# unnecessarilyrecords.group_by{|record|class_to_reflection[record.class]||=record.class.reflections[association]}.eachdo|reflection,records|raiseConfigurationError,"Association named '#{ association }' was not found; perhaps you misspelled it?"unlessreflection# 'reflection.macro' can return 'belongs_to', 'has_many', etc. Thus,# the following could call 'preload_belongs_to_association',# 'preload_has_many_association', etc.send("preload_#{reflection.macro}_association",records,reflection,preload_options)endend