I have a User model that has a :credits attribute. I want a simple button that will add 5 to the user\'s credits, through a route called \"add\" so that /users/3/add would ad
You have a number of options, including changing which callback you use, e.g., after_create
.
You can update columns without triggering callbacks, see Skipping Callbacks in the AR guide. For example, update_column
doesn't trigger callbacks. The previous link lists non-triggering functions.
You could also use any of the Conditional Callback forms (or even an observer) for when the password is changed. See ActiveModel::Dirty, e.g., @user.password_changed?
.