Class: Card

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
TransitionManager
Defined in:
app/models/card.rb

Overview

This class models a Card, which is a unit of work in a project.

The card contains a number of details about what it is about: its title and description obviously but also its nature (business, technical,…), its size (pre-play and post-mortem) and its lifecycle (status, iteration raised, iteration closed, release delivered,…)

Instance Method Summary collapse

Methods included from TransitionManager

#apply_transition, #successor_statuses, #transition_allowed?

Instance Method Details

#before_saveObject



33
34
35
36
37
# File 'app/models/card.rb', line 33

def before_save
  update_status()
  update_priority()
  update_release_delivered()
end

#before_updateObject



39
40
41
42
43
# File 'app/models/card.rb', line 39

def before_update
  update_status()
  update_priority()
  update_release_delivered()
end

#statusObject



23
24
25
# File 'app/models/card.rb', line 23

def status
  Status.get(read_attribute(:status_name))
end

#status=(status) ⇒ Object



27
28
29
30
31
# File 'app/models/card.rb', line 27

def status=(status)
  if (! status.nil?())
    apply_transition(self,status)
  end
end