Class: Fulcrum::Cloudfuji::EventObservers::ProjectTaskObserver
- Inherits:
-
Cloudfuji::EventObserver
- Object
- Cloudfuji::EventObserver
- Fulcrum::Cloudfuji::EventObservers::ProjectTaskObserver
- Defined in:
- lib/fulcrum/cloudfuji/event_observers/project_task_observer.rb
Instance Method Summary collapse
Instance Method Details
#project_task_created ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fulcrum/cloudfuji/event_observers/project_task_observer.rb', line 6 def project_task_created data = params['data'] story = Story.find_by_ido_id(data['ido_id']) story ||= Story.new # Just in case story.ido_id ||= data['ido_id'] story.title = data['title'] story.description = data['description'] story.estimate = data['estimate'] story.story_type = data['task_type'] story.state = data['state'] story.accepted_at = data['accepted_at'] # :accepted_at must be populated if state is accepted. story.accepted_at ||= Time.now.to_date if story.state == "accepted" story.requested_by = User.find_by_ido_id(data['requested_by_id']) story.owned_by = User.find_by_ido_id(data['owned_by_id']) story.project = Project.find_by_ido_id(data['project_id']) story.labels = data['labels'] story.save! end |
#project_task_imported ⇒ Object
34 35 36 |
# File 'lib/fulcrum/cloudfuji/event_observers/project_task_observer.rb', line 34 def project_task_imported project_task_created end |
#project_task_updated ⇒ Object
30 31 32 |
# File 'lib/fulcrum/cloudfuji/event_observers/project_task_observer.rb', line 30 def project_task_updated project_task_created end |