Skip to content

Instantly share code, notes, and snippets.

@maccman
Created April 15, 2009 11:44
Show Gist options
  • Select an option

  • Save maccman/95727 to your computer and use it in GitHub Desktop.

Select an option

Save maccman/95727 to your computer and use it in GitHub Desktop.
module TransactionalIncrement
def increment!(att, by = 1)
increment(att, by)
changed_attributes.delete(att.to_s)
self.class.update_counters(id, att => by)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment