class SchemaValidations::Config
The configuation options for SchemaValidations
. Set them globally in config/initializers/schema_validations.rb
, e.g.:
SchemaValidations.setup do |config| config.auto_create = false end
or override them per-model, e.g.:
class MyModel < ActiveRecord::Base schema_validations :only => [:name, :active] end
Attributes
Whether to automatically create validations based on database constraints. Boolean, default is true
.
List of field names to exclude from automatic validation. Value is a single name, and array of names, or nil
. Default is nil
.
List of validation types to exclude from automatic validation. Value is a single type, and array of types, or nil
. Default is nil
. A type is specified as, e.g., :validates_presence_of
or simply :presence
.
List of field names to include in automatic validation. Value is a single name, and array of names, or nil
. Default is nil
.
List of validation types to include in automatic validation. Value is a single type, and array of types, or nil
. Default is nil
. A type is specified as, e.g., :validates_presence_of
or simply :presence
.
List of field names to exclude from automatic validation. Value is a single name, an array of names, or nil
. Default is [:created_at, :updated_at, :created_on, :updated_on]
.
List of validation types to exclude from automatic validation. Value is a single type, and array of types, or nil
. Default is nil
. A type is specified as, e.g., :validates_presence_of
or simply :presence
.