Class: AskIt::Attempt
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- AskIt::Attempt
- Defined in:
- app/models/ask_it/attempt.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.high_score ⇒ Object
63 64 65 |
# File 'app/models/ask_it/attempt.rb', line 63 def self.high_score scores.first.score end |
Instance Method Details
#collect_scores! ⇒ Object
58 59 60 61 |
# File 'app/models/ask_it/attempt.rb', line 58 def collect_scores! collect_scores save end |
#correct_answers ⇒ Object
50 51 52 |
# File 'app/models/ask_it/attempt.rb', line 50 def correct_answers answers.where(correct: true) end |
#incorrect_answers ⇒ Object
54 55 56 |
# File 'app/models/ask_it/attempt.rb', line 54 def incorrect_answers answers.where(correct: false) end |