diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-03 10:23:42 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-03 10:23:42 +0000 |
commit | b4b178f7e9a00a0235574a773cdbc06fe856acaf (patch) | |
tree | d5617680e972962e78dd0a8e3fad19e208451d0f /activerecord/lib | |
parent | 982a0f37f5239527e9db9225b1dc7e42c6a98417 (diff) | |
download | rails-b4b178f7e9a00a0235574a773cdbc06fe856acaf.tar.gz rails-b4b178f7e9a00a0235574a773cdbc06fe856acaf.tar.bz2 rails-b4b178f7e9a00a0235574a773cdbc06fe856acaf.zip |
Fix #3247.
Fixes creating records in a through association with a polymorphic source
type.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/through_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/through_association.rb b/activerecord/lib/active_record/associations/through_association.rb index b347a94978..f95e5337c2 100644 --- a/activerecord/lib/active_record/associations/through_association.rb +++ b/activerecord/lib/active_record/associations/through_association.rb @@ -44,7 +44,7 @@ module ActiveRecord join_attributes = { source_reflection.foreign_key => records.map { |record| - record.send(source_reflection.association_primary_key) + record.send(source_reflection.association_primary_key(reflection.klass)) } } |