Class: Item

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/my_todo/models/item.rb

Overview

Handles business logic for todo item

Author:

  • Lovell McIlwain#

Constant Summary collapse

INCOMPLETE_STATUSES =
['None', 'In Progress', 'Waiting Feedback']
COMPLETE_STATUSES =
['Complete', 'Punted']
DETAILED_STATUSES =
INCOMPLETE_STATUSES + COMPLETE_STATUSES

Instance Method Summary collapse

Instance Method Details

#update_doneObject

set done attribute based on detailed_status set



29
30
31
# File 'lib/my_todo/models/item.rb', line 29

def update_done
  self.done = true if COMPLETE_STATUSES.include? self.detailed_status
end