app/models/rapidfire/answer.rb in rapidfire-3.0.0 vs app/models/rapidfire/answer.rb in rapidfire-3.1.0
- old
+ new
@@ -2,17 +2,18 @@
class Answer < ActiveRecord::Base
belongs_to :question
belongs_to :attempt, inverse_of: :answers
validates :question, :attempt, presence: true
- validate :verify_answer_text, :if => "question.present?"
+ validate :verify_answer_text
if Rails::VERSION::MAJOR == 3
attr_accessible :question_id, :attempt, :answer_text
end
private
def verify_answer_text
+ return false unless question.present?
question.validate_answer(self)
end
end
end