Module: NoBrainer::Document::Callbacks
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/no_brainer/document/callbacks.rb
Class Method Summary collapse
Instance Method Summary collapse
- #_create(*args, &block) ⇒ Object
- #_update_only_changed_attrs(*args, &block) ⇒ Object
- #destroy(*args, &block) ⇒ Object
- #initialize(*args, &block) ⇒ Object
- #save?(*args, &block) ⇒ Boolean
Class Method Details
.define_callbacks_options(options = {}) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/no_brainer/document/callbacks.rb', line 4 def self.(={}) if ActiveSupport::Callbacks.respond_to?(:halt_and_display_warning_on_return_false) ActiveSupport::Callbacks.halt_and_display_warning_on_return_false = false end NoBrainer.rails5? ? : .merge(:terminator => proc { false }) end |
Instance Method Details
#_create(*args, &block) ⇒ Object
22 23 24 |
# File 'lib/no_brainer/document/callbacks.rb', line 22 def _create(*args, &block) run_callbacks(:create) { super } end |
#_update_only_changed_attrs(*args, &block) ⇒ Object
26 27 28 |
# File 'lib/no_brainer/document/callbacks.rb', line 26 def _update_only_changed_attrs(*args, &block) run_callbacks(:update) { super } end |
#destroy(*args, &block) ⇒ Object
34 35 36 |
# File 'lib/no_brainer/document/callbacks.rb', line 34 def destroy(*args, &block) run_callbacks(:destroy) { super } end |
#initialize(*args, &block) ⇒ Object
18 19 20 |
# File 'lib/no_brainer/document/callbacks.rb', line 18 def initialize(*args, &block) run_callbacks(:initialize) { _initialize(*args, &block); true } end |
#save?(*args, &block) ⇒ Boolean
30 31 32 |
# File 'lib/no_brainer/document/callbacks.rb', line 30 def save?(*args, &block) run_callbacks(:save) { super } end |