Class: CloudfujiStoryObserver
- Inherits:
-
ActiveRecord::Observer
- Object
- ActiveRecord::Observer
- CloudfujiStoryObserver
- Defined in:
- app/observers/cloudfuji_story_observer.rb
Instance Method Summary collapse
Instance Method Details
#after_create(story) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/observers/cloudfuji_story_observer.rb', line 4 def after_create(story) return unless ::Cloudfuji::Platform.on_cloudfuji? event = { :category => :project_task, :name => :created, :data => event_data_for_story(story) } puts "Publishing Cloudfuji Event: #{event.inspect}" ::Cloudfuji::Event.publish(event) end |
#after_update(story) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/observers/cloudfuji_story_observer.rb', line 17 def after_update(story) return unless ::Cloudfuji::Platform.on_cloudfuji? event = { :category => :project_task, :name => :updated, :data => event_data_for_story(story) } puts "Publishing Cloudfuji Event: #{event.inspect}" ::Cloudfuji::Event.publish(event) end |