diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-19 15:04:39 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-19 15:07:11 -0300 |
commit | 9ac81b954ab62077576d858042df918b2f7b305f (patch) | |
tree | d653748582185d552fdb939d4f00675a3ca6a21c /activerecord/lib | |
parent | 008870e6a4043bd217738aa6f3cdda1f0ea74947 (diff) | |
parent | 30b76e5575c57056361741ebbede972f8ef477de (diff) | |
download | rails-9ac81b954ab62077576d858042df918b2f7b305f.tar.gz rails-9ac81b954ab62077576d858042df918b2f7b305f.tar.bz2 rails-9ac81b954ab62077576d858042df918b2f7b305f.zip |
Merge pull request #15772 from nbudin/sti_through_bug
Don't include inheritance column in the through_scope_attributes
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_through_association.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index 175019a72b..35e176622d 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -93,7 +93,9 @@ module ActiveRecord end def through_scope_attributes - scope.where_values_hash(through_association.reflection.name.to_s).except!(through_association.reflection.foreign_key) + scope.where_values_hash(through_association.reflection.name.to_s). + except!(through_association.reflection.foreign_key, + through_association.reflection.klass.inheritance_column) end def save_through_record(record) |