Method: Sequel::Plugins::ValidationHelpers::InstanceMethods#validates_schema_types
- Defined in:
- lib/sequel/plugins/validation_helpers.rb
#validates_schema_types(atts = keys, opts = OPTS) ⇒ Object
Validates for all of the model columns (or just the given columns) that the column value is an instance of the expected class based on the column’s schema type.
204 205 206 207 208 209 210 |
# File 'lib/sequel/plugins/validation_helpers.rb', line 204 def validates_schema_types(atts=keys, opts=OPTS) Array(atts).each do |k| if type = schema_type_class(k) validates_type(type, k, {:allow_nil=>true}.merge!(opts)) end end end |