Class: Trollo::Task

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
SearchCop, Troller, Workflow
Defined in:
lib/trollo/task.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Troller

included

Class Method Details

.overdueObject



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

Returns:

  • (Boolean)


36
37
38
# File 'lib/trollo/task.rb', line 36

def overdue?
  incomplete? && due_at && (Time.now > due_at)
end

#set_ordinalObject



32
33
34
# File 'lib/trollo/task.rb', line 32

def set_ordinal
  self.ordinal ||= tasklist.tasks.count + 1
end

#update_tasklistObject



40
41
42
# File 'lib/trollo/task.rb', line 40

def update_tasklist
  tasklist.check
end