I'm trying to update single attribute of a user model from a admin controller (not users controller).
While doing this I tried update_attribute()
but it was changing the users password also.
I think the password is changing because I have before_save method on user model which hashes the password.
update_attributes()
is not working because it is checking the validations for password which is presence=>true
Is there any way to achieve this?
Try update_column(name, value)
, it might work.