Permalink
Browse files

just read the attribute rather than `send`ing

  • Loading branch information...
1 parent 8f9bba7 commit a04965b40e0edc4ab093276cea6353f55199c3de @tenderlove tenderlove committed Sep 20, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations/preloader.rb
@@ -159,7 +159,7 @@ def raise_config_error(association)
def association_klass(reflection, record)
if reflection.macro == :belongs_to && reflection.options[:polymorphic]
- klass = record.send(reflection.foreign_type)
+ klass = record.read_attribute(reflection.foreign_type.to_s)
klass && klass.constantize
else
reflection.klass

0 comments on commit a04965b

Please sign in to comment.