Module: Primer::Watcher::ActiveRecordMacros::InstanceMethods
- Defined in:
- lib/primer/watcher/active_record_macros.rb
Instance Method Summary collapse
- #notify_primer_after_create ⇒ Object
- #notify_primer_after_destroy ⇒ Object
- #notify_primer_after_update ⇒ Object
- #primer_identifier ⇒ Object
Instance Method Details
#notify_primer_after_create ⇒ Object
64 65 66 |
# File 'lib/primer/watcher/active_record_macros.rb', line 64 def notify_primer_after_create Primer.bus.publish(:active_record, ['create', self.class.name, attributes]) end |
#notify_primer_after_destroy ⇒ Object
72 73 74 |
# File 'lib/primer/watcher/active_record_macros.rb', line 72 def notify_primer_after_destroy Primer.bus.publish(:active_record, ['destroy', self.class.name, attributes]) end |
#notify_primer_after_update ⇒ Object
68 69 70 |
# File 'lib/primer/watcher/active_record_macros.rb', line 68 def notify_primer_after_update Primer.bus.publish(:active_record, ['update', self.class.name, attributes, changes]) end |
#primer_identifier ⇒ Object
60 61 62 |
# File 'lib/primer/watcher/active_record_macros.rb', line 60 def primer_identifier ['ActiveRecord', self.class.name, read_attribute(self.class.primary_key)] end |