Lets say we have a simple model that stores two integers, the min and the max. We would like to force min <= max
.
class MinMax
include MongoMapper::Document
key :min, Integer
key :max, Integer
validate_presence_of :min, :max
end
1) How would you validate that min is indeed equal or less than max?
2) If you don't think this is the responsibility of the model, then where and who should do that validation?