Skip to content


increment! doesn't call before_update callback #7306

mperham opened this Issue · 10 comments

6 participants


Rails 3.2.8 breaks several tests we had around ActiveRecord increment / decrement. Specifically we aren't seeing a before_update callback triggered when we call record.increment!(:quantity, 1). The documentation says that it skips validation but says nothing about callbacks in general.

Ruby on Rails member

Sorry for not trying out rc2. :-( :chicken:

Ruby on Rails member

@steveklabnik this is easy to fix. Just revert this commit b081f6b.

But we need to know if is expected to increment and related method to run callbacks.

Ruby on Rails member

@rafaelfranca I thought 3.2.8 was meant to remove all deprecations introduced after 3.2.0 ?

Ruby on Rails member

Yes, we removed the deprecation but not all the changes. See f203be9 and 81542f9.

Sorry guys. I should have reviewed this better before the release :broken_heart:


toggle no longer triggers before_update aswell.

@rafaelfranca rafaelfranca was assigned
@rafaelfranca rafaelfranca added a commit that closed this issue
@rafaelfranca rafaelfranca Do not use update_column where update_attribute is not interchangeable
Revert "Deprecate update_attribute."

This reverts commit b081f6b.

Reason: Since the new deprecation policy we removed the deprecation of
update_attribute but we didn't reverted the changes to use

Fixes #7306
Ruby on Rails member

@tobsch did you mean toggle!?

If so it was fixed with increment! and decrement! in my last commit.


yeah, sorry.


So… are increment and increment! supposed to execute callbacks?

Ruby on Rails member


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.