Module: ActiveRecord::Suppressor::ClassMethods

Defined in:
activerecord/lib/active_record/suppressor.rb

Instance Method Summary collapse

Instance Method Details

#suppress(&block) ⇒ Object



34
35
36
37
38
39
40
# File 'activerecord/lib/active_record/suppressor.rb', line 34

def suppress(&block)
  previous_state = SuppressorRegistry.suppressed[name]
  SuppressorRegistry.suppressed[name] = true
  yield
ensure
  SuppressorRegistry.suppressed[name] = previous_state
end