Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/towncrier/active_record_extensions.rb

Direct Known Subclasses

Towncry

Instance Method Summary collapse

Instance Method Details

#broadcase_update_towncryObject



10
11
12
# File 'lib/towncrier/active_record_extensions.rb', line 10

def broadcase_update_towncry
  broadcast_towncry(:update)
end

#broadcast_create_towncryObject



6
7
8
# File 'lib/towncrier/active_record_extensions.rb', line 6

def broadcast_create_towncry
  broadcast_towncry(:create)
end

#broadcast_towncry(action) ⇒ Object



14
15
16
17
# File 'lib/towncrier/active_record_extensions.rb', line 14

def broadcast_towncry action
  info = { :class => self.class.name, :id => self.id, :action => action }
  ActiveSupport::Notifications.instrument('towncry', info)
end