Class: Tasuku::Taskables::Question::Answer
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Tasuku::Taskables::Question::Answer
- Includes:
- Taskable::Submission
- Defined in:
- app/models/tasuku/taskables/question/answer.rb
Instance Method Summary collapse
Instance Method Details
#correct? ⇒ Boolean
20 21 22 |
# File 'app/models/tasuku/taskables/question/answer.rb', line 20 def correct? votes.all? { |vote| vote.option.correct? } end |
#question ⇒ Object
14 15 16 |
# File 'app/models/tasuku/taskables/question/answer.rb', line 14 def question votes.first.option.question if votes.any? end |