Skip to content

Commit

Permalink
Do not try to set the foreign_key again on has_many through
Browse files Browse the repository at this point in the history
Integration tests are inside protected_attributes test suite.

Fixes #15496
Fixes rails/protected_attributes#35
  • Loading branch information
rafaelfranca committed Jun 9, 2014
1 parent 66eb847 commit 19f1cfb
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -89,7 +89,7 @@ def build_through_record(record)
end

def through_scope_attributes
scope.where_values_hash(through_association.reflection.name.to_s)
scope.where_values_hash(through_association.reflection.name.to_s).except!(through_association.reflection.foreign_key)
end

def save_through_record(record)
Expand Down

0 comments on commit 19f1cfb

Please sign in to comment.