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.
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.now if date.nil? if progress.nil? self.progress = task ? task.progress : 0 end end |
Instance Method Details
#update_task_progress ⇒ Object
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 |