私のコントローラーは、更新時にこのモデル メソッドを呼び出します。
def update_standard(param_attributes)
...
if param_attributes[:is_legacy] == true
param_attributes[:foo_type_id] = 2
end
update_attributes(param_attributes)
end
foo_type_id
ユーザーがフォームに入力したものはすべて上書きする必要がありますが、DB に書き込まれるのはユーザーの選択です。が true のfoo_type_id
ときに 2 であることを強制するにはどうすればよいですか?is_legacy