I have the following code in a controller action, which looks at a user, and changes a boolean value to the opposite value, so if the user is true then it becomes false, and vice versa:
if current_user.enable_access
current_user.update_attribute(:enable_access, false)
else
current_user.update_attribute(:enable_access, true)
end
Is there a neater way of writing this?