Class: Flyboy::TaskComment
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Flyboy::TaskComment
- Defined in:
- app/models/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.
12 13 14 15 16 17 18 19 20 |
# File 'app/models/flyboy/task_comment.rb', line 12 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
24 25 26 27 28 29 |
# File 'app/models/flyboy/task_comment.rb', line 24 def update_task_progress task.update_attributes( :progress => progress, :done => progress.equal?(100) ) end |