Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 7th, 2012  |  syntax: None  |  size: 0.25 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class SomeModel < ActiveRecord::Base
  2.   before_save :some_callback
  3.   after_save :some_other_callback
  4.  
  5.   # stuff...
  6.  
  7.   def update_attributes_without_callbacks(attributes={})
  8.     self.class.where(id: id).update_all(attributes)
  9.   end
  10.  
  11.   # more stuff...
  12.  
  13. end