I understand strong parameters are used in cases where we are creating an object and putting it into our database. For example,
User.create(params[:user])
would have to be User.create(params.require(:user).permit(:name, :email, :password)
.
This is standard and simple to understand, however, are strong parameters required when updating a column or a few attributes in a model?
current_user.update_attributes(params[:user])
. Does that have to be current_user.update_attributes(params.require(:user).permit(:name, :email, :password)
.
Lastly, I don't think it is needed for this case:
current_user.update_column(authentication_token: nil)
, but would it have needed to be updated if instead we had params = { authentication_token: nil }
, and did current_user.update_column(params)
?