Skip to content

Instantly share code, notes, and snippets.

@jbgo
Created June 14, 2012 18:40
Show Gist options
  • Save jbgo/2932085 to your computer and use it in GitHub Desktop.
Save jbgo/2932085 to your computer and use it in GitHub Desktop.
Update attributes without callbacks
class SomeModel < ActiveRecord::Base
before_save :some_callback
after_save :some_other_callback
# stuff...
def update_attributes_without_callbacks(attributes={})
self.class.where(id: id).update_all(attributes)
end
# more stuff...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment