I need your help validating a simple Rails model.
First i want to check if the user filled all input-fields:
class Test < ActiveRecord::Base
   validates :firstname, :lastname, :firstvalue, :secondvalue, presence: true
   [...]
I also want to check if the :secondvalue param is bigger than :firstvalue.
Adding
validate :biggerThan
def biggerThan
    if self.secondvalue < self.firstvalue
        errors.add(:secondvalue, "must be bigger than First")
    end
end
Well this works, but only if all other fields are filled! Creating a new Entry leaving all fields blank i am getting an undefined method <' for nil:NilClass.
Could you help me?
