Class: Trollo::Task
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Trollo::Task
- Includes:
- SearchCop, Troller, Workflow
- Defined in:
- lib/trollo/task.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Troller
Class Method Details
.overdue ⇒ Object
18 19 20 |
# File 'lib/trollo/task.rb', line 18 def self.overdue with_incomplete_state.where('due_at IS NOT NULL AND due_at < ?', Time.now) end |
Instance Method Details
#overdue? ⇒ Boolean
36 37 38 |
# File 'lib/trollo/task.rb', line 36 def overdue? incomplete? && due_at && (Time.now > due_at) end |
#set_ordinal ⇒ Object
32 33 34 |
# File 'lib/trollo/task.rb', line 32 def set_ordinal self.ordinal ||= tasklist.tasks.count + 1 end |
#update_tasklist ⇒ Object
40 41 42 |
# File 'lib/trollo/task.rb', line 40 def update_tasklist tasklist.check end |