Displaying 1 result from an estimated 1 matches for "fifty_fifty".
2009 Oct 27
5
Unwanted call to validates_associated
...return nil
end
end
end
class MillionaireAnswer < ActiveRecord::Base
acts_as_list :scope => :millionaire_question
belongs_to :question, :class_name => "MillionaireQuestion"
named_scope :correct, :conditions => ["correct = ?", true]
named_scope :fifty_fifty, :conditions => ["fifty_fifty = ?", true]
validates_presence_of :text
validate :cannot_be_true_and_fifty_fifty
def letter
self.position ? %w(x A B C D)[self.position] : nil
end
def cannot_be_true_and_fifty_fifty
errors.add_to_base("Answer is marked as the corr...