The problem is that using the .where
function creates a relation, rather than finding the record itself. Do this:
ian = User.find(5)
ian.update_attribute(:roles_mask, '1')
Or if you want to use .where
then you could do this:
ian = User.where(:id => 5)
ian.first.update_attribute(:roles_mask, '1')
EDIT
See this answer for details about why this is happening.