Class: Dorsale::Flyboy::TaskComment

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/dorsale/flyboy/task_comment.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ TaskComment

Returns a new instance of TaskComment.



17
18
19
20
21
22
23
24
25
# File 'app/models/dorsale/flyboy/task_comment.rb', line 17

def initialize(*args)
  super

  self.date = Time.zone.now if date.nil?

  if progress.nil?
    self.progress = task ? task.progress : 0
  end
end

Instance Method Details

#update_task_progressObject



29
30
31
32
33
34
# File 'app/models/dorsale/flyboy/task_comment.rb', line 29

def update_task_progress
  task.update_attributes!(
    :progress => progress,
    :done     => progress.equal?(100)
  )
end