diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-09-20 11:56:59 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-09-20 11:56:59 -0700 |
commit | a04965b40e0edc4ab093276cea6353f55199c3de (patch) | |
tree | 9d9862408c98f82b316e7ce8ea1ef2e8750c5358 /activerecord | |
parent | 8f9bba7058c5ff376c7fbcd0f2d5561758085b8e (diff) | |
download | rails-a04965b40e0edc4ab093276cea6353f55199c3de.tar.gz rails-a04965b40e0edc4ab093276cea6353f55199c3de.tar.bz2 rails-a04965b40e0edc4ab093276cea6353f55199c3de.zip |
just read the attribute rather than `send`ing
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb index 6732a5eb8d..dca7179953 100644 --- a/activerecord/lib/active_record/associations/preloader.rb +++ b/activerecord/lib/active_record/associations/preloader.rb @@ -159,7 +159,7 @@ module ActiveRecord 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 |