Created
June 14, 2012 18:40
-
-
Save jbgo/2932085 to your computer and use it in GitHub Desktop.
Update attributes without callbacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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