Module: Sechat::Models::Reply
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/sechat/models/reply.rb
Instance Method Summary collapse
-
#update_question_status ⇒ Object
Updates the answered column of associated question.
Instance Method Details
#update_question_status ⇒ Object
Updates the answered column of associated question. This is called automatically on save if the answer status changed.
15 16 17 18 |
# File 'lib/sechat/models/reply.rb', line 15 def update_question_status question.answered = answer || self.class.where(:question_id => question_id, :answer => true).any? question.save end |