I\'ve got a Trip model, which among other attributes has a start_odometer and end_odometer value. In my model, i\'d like to validate that the end odometer is larger than the st
You don't necessarily need a custom validation method for this case. In fact, it's a bit overkill when you can do it with one line. jn80842's suggestion is close, but you must wrap it in a Proc or Lambda for it to work.
validates_numericality_of :end_odometer, :greater_than => Proc.new { |r| r.start_odometer }, :allow_blank => true