Do not try to set the foreign_key again on has_many through

Integration tests are inside protected_attributes test suite.

Fixes #15496
Fixes rails/protected_attributes#35
上级 66eb847c
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册