Method: Sequel::Plugins::ValidationHelpers::InstanceMethods#validates_min_value

Defined in:
lib/sequel/plugins/validation_helpers.rb

#validates_min_value(min, atts, opts = OPTS) ⇒ Object

Check that the attribute values are not less that the given minimum value. Does not perform validation if attribute value is nil. You should only call this if you have checked the attribute value has the expected type.



167
168
169
170
171
# File 'lib/sequel/plugins/validation_helpers.rb', line 167

def validates_min_value(min, atts, opts=OPTS)
  validatable_attributes_for_type(:min_value, atts, opts) do |a,v,m|
    validation_error_message(m, min) if !v.nil? && v < min
  end
end