I\'m trying to create a condition in which the attribute \'one\' is zero and the attribute \'two\' is one, then a model is not valid. But when I make:
Model.
You are better off using numericality and equal to.
validates :one, :numericality => { :equal_to => 0 } validates :two, :numericality => { :equal_to => 1 }
http://guides.rubyonrails.org/active_record_validations_callbacks.html#numericality