Module: Sequel::Plugins::InstanceHooks::InstanceMethods
- Defined in:
- lib/sequel/plugins/instance_hooks.rb
Instance Method Summary collapse
-
#after_destroy ⇒ Object
Run after destroy instance hooks.
-
#after_save ⇒ Object
Run after save instance hooks.
-
#after_validation ⇒ Object
Run after validation instance hooks.
-
#before_destroy ⇒ Object
Run before_destroy instance hooks.
-
#before_save ⇒ Object
Run before_save instance hooks.
Instance Method Details
#after_destroy ⇒ Object
Run after destroy instance hooks.
52 53 54 55 56 57 58 |
# File 'lib/sequel/plugins/instance_hooks.rb', line 52 def after_destroy super return unless @instance_hooks run_after_instance_hooks(:after_destroy) @instance_hooks.delete(:after_destroy) @instance_hooks.delete(:before_destroy) end |
#after_save ⇒ Object
Run after save instance hooks.
68 69 70 71 72 73 74 75 76 |
# File 'lib/sequel/plugins/instance_hooks.rb', line 68 def after_save super return unless @instance_hooks run_after_instance_hooks(:after_save) @instance_hooks.delete(:after_save) @instance_hooks.delete(:before_save) @instance_hooks.delete(:after_validation) @instance_hooks.delete(:before_validation) end |
#after_validation ⇒ Object
Run after validation instance hooks.
61 62 63 64 65 |
# File 'lib/sequel/plugins/instance_hooks.rb', line 61 def after_validation super return unless @instance_hooks run_after_instance_hooks(:after_validation) end |
#before_destroy ⇒ Object
Run before_destroy instance hooks.
79 80 81 82 83 |
# File 'lib/sequel/plugins/instance_hooks.rb', line 79 def before_destroy return super unless @instance_hooks run_before_instance_hooks(:before_destroy) super end |
#before_save ⇒ Object
Run before_save instance hooks.
86 87 88 89 90 |
# File 'lib/sequel/plugins/instance_hooks.rb', line 86 def before_save return super unless @instance_hooks run_before_instance_hooks(:before_save) super end |