Class: Dorsale::Flyboy::TaskComment
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Dorsale::Flyboy::TaskComment
- Defined in:
- app/models/dorsale/flyboy/task_comment.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ TaskComment
constructor
A new instance of TaskComment.
- #update_task_progress ⇒ Object
Constructor Details
#initialize(*args) ⇒ TaskComment
Returns a new instance of TaskComment.
15 16 17 18 19 20 21 22 23 |
# File 'app/models/dorsale/flyboy/task_comment.rb', line 15 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_progress ⇒ Object
27 28 29 30 31 32 |
# File 'app/models/dorsale/flyboy/task_comment.rb', line 27 def update_task_progress task.update!( :progress => progress, :done => progress.equal?(100) ) end |