Module: Eventish::ActiveRecord::Callback
- Defined in:
- lib/eventish/active_record/callback.rb
Instance Method Summary collapse
-
#after_commit_event(*args) ⇒ Object
Commit events.
- #after_create_commit_event(*args) ⇒ Object
- #after_create_event(*args) ⇒ Object
- #after_destroy_commit_event(*args) ⇒ Object
- #after_destroy_event(*args) ⇒ Object
- #after_find_event(*args) ⇒ Object
-
#after_initialize_event(*args) ⇒ Object
Init events.
- #after_rollback_event(*args) ⇒ Object
- #after_save_commit_event(*args) ⇒ Object
- #after_save_event(*args) ⇒ Object
-
#after_touch_event(*args) ⇒ Object
Touch events.
- #after_update_commit_event(*args) ⇒ Object
- #after_update_event(*args) ⇒ Object
- #after_validation_event(*args) ⇒ Object
- #around_create_event(*args) ⇒ Object
- #around_destroy_event(*args) ⇒ Object
- #around_save_event(*args) ⇒ Object
- #around_update_event(*args) ⇒ Object
-
#before_create_event(*args) ⇒ Object
Create events.
-
#before_destroy_event(*args) ⇒ Object
Destroy events.
-
#before_save_event(*args) ⇒ Object
Save events.
-
#before_update_event(*args) ⇒ Object
Update events.
-
#before_validation_event(*args) ⇒ Object
Validation events.
Instance Method Details
#after_commit_event(*args) ⇒ Object
Commit events
93 94 95 96 |
# File 'lib/eventish/active_record/callback.rb', line 93 def after_commit_event(*args) event = args.shift after_commit -> { ::Eventish.publish(event, self) }, *args end |
#after_create_commit_event(*args) ⇒ Object
98 99 100 101 |
# File 'lib/eventish/active_record/callback.rb', line 98 def after_create_commit_event(*args) event = args.shift after_create_commit -> { ::Eventish.publish(event, self) }, *args end |
#after_create_event(*args) ⇒ Object
39 40 41 42 |
# File 'lib/eventish/active_record/callback.rb', line 39 def after_create_event(*args) event = args.shift after_create -> { ::Eventish.publish(event, self) }, *args end |
#after_destroy_commit_event(*args) ⇒ Object
113 114 115 116 |
# File 'lib/eventish/active_record/callback.rb', line 113 def after_destroy_commit_event(*args) event = args.shift after_destroy_commit -> { ::Eventish.publish(event, self) }, *args end |
#after_destroy_event(*args) ⇒ Object
87 88 89 90 |
# File 'lib/eventish/active_record/callback.rb', line 87 def after_destroy_event(*args) event = args.shift after_destroy -> { ::Eventish.publish(event, self) }, *args end |
#after_find_event(*args) ⇒ Object
12 13 14 15 |
# File 'lib/eventish/active_record/callback.rb', line 12 def after_find_event(*args) event = args.shift after_find -> { ::Eventish.publish(event, self) }, *args end |
#after_initialize_event(*args) ⇒ Object
Init events
7 8 9 10 |
# File 'lib/eventish/active_record/callback.rb', line 7 def after_initialize_event(*args) event = args.shift after_initialize -> { ::Eventish.publish(event, self) }, *args end |
#after_rollback_event(*args) ⇒ Object
118 119 120 121 |
# File 'lib/eventish/active_record/callback.rb', line 118 def after_rollback_event(*args) event = args.shift after_rollback -> { ::Eventish.publish(event, self) }, *args end |
#after_save_commit_event(*args) ⇒ Object
108 109 110 111 |
# File 'lib/eventish/active_record/callback.rb', line 108 def after_save_commit_event(*args) event = args.shift after_save_commit -> { ::Eventish.publish(event, self) }, *args end |
#after_save_event(*args) ⇒ Object
71 72 73 74 |
# File 'lib/eventish/active_record/callback.rb', line 71 def after_save_event(*args) event = args.shift after_save -> { ::Eventish.publish(event, self) }, *args end |
#after_touch_event(*args) ⇒ Object
Touch events
124 125 126 127 |
# File 'lib/eventish/active_record/callback.rb', line 124 def after_touch_event(*args) event = args.shift after_touch -> { ::Eventish.publish(event, self) }, *args end |
#after_update_commit_event(*args) ⇒ Object
103 104 105 106 |
# File 'lib/eventish/active_record/callback.rb', line 103 def after_update_commit_event(*args) event = args.shift after_update_commit -> { ::Eventish.publish(event, self) }, *args end |
#after_update_event(*args) ⇒ Object
55 56 57 58 |
# File 'lib/eventish/active_record/callback.rb', line 55 def after_update_event(*args) event = args.shift after_update -> { ::Eventish.publish(event, self) }, *args end |
#after_validation_event(*args) ⇒ Object
23 24 25 26 |
# File 'lib/eventish/active_record/callback.rb', line 23 def after_validation_event(*args) event = args.shift after_validation -> { ::Eventish.publish(event, self) }, *args end |
#around_create_event(*args) ⇒ Object
34 35 36 37 |
# File 'lib/eventish/active_record/callback.rb', line 34 def around_create_event(*args) event = args.shift around_create ->(_object, block) { ::Eventish.publish(event, self, block: block) }, *args end |
#around_destroy_event(*args) ⇒ Object
82 83 84 85 |
# File 'lib/eventish/active_record/callback.rb', line 82 def around_destroy_event(*args) event = args.shift around_destroy ->(_object, block) { ::Eventish.publish(event, self, block: block) }, *args end |
#around_save_event(*args) ⇒ Object
66 67 68 69 |
# File 'lib/eventish/active_record/callback.rb', line 66 def around_save_event(*args) event = args.shift around_save ->(_object, block) { ::Eventish.publish(event, self, block: block) }, *args end |
#around_update_event(*args) ⇒ Object
50 51 52 53 |
# File 'lib/eventish/active_record/callback.rb', line 50 def around_update_event(*args) event = args.shift around_update ->(_object, block) { ::Eventish.publish(event, self, block: block) }, *args end |
#before_create_event(*args) ⇒ Object
Create events
29 30 31 32 |
# File 'lib/eventish/active_record/callback.rb', line 29 def before_create_event(*args) event = args.shift before_create -> { ::Eventish.publish(event, self) }, *args end |
#before_destroy_event(*args) ⇒ Object
Destroy events
77 78 79 80 |
# File 'lib/eventish/active_record/callback.rb', line 77 def before_destroy_event(*args) event = args.shift before_destroy -> { ::Eventish.publish(event, self) }, *args end |
#before_save_event(*args) ⇒ Object
Save events
61 62 63 64 |
# File 'lib/eventish/active_record/callback.rb', line 61 def before_save_event(*args) event = args.shift before_save -> { ::Eventish.publish(event, self) }, *args end |