Module: Primer::Watcher::ActiveRecordMacros::InstanceMethods

Defined in:
lib/primer/watcher/active_record_macros.rb

Instance Method Summary collapse

Instance Method Details

#notify_primer_after_createObject



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_destroyObject



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_updateObject



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_identifierObject



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