6 ms·
No, that's not entirely correct. You can do @user.public_keys.find(params[:id]).update_attributes(:user_id => 25) Its the mass assignment protection on foreig
by hitonagashi 15y ago
No, that's not entirely correct.
You can do @user.public_keys.find(params[:id]).update_attributes(:user_id => 25)
Its the mass assignment protection on foreign keys that prevents you assigning one of your public keys to someone else, ensuring the chain is correct doesn't necessarily help with this scenario.