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

auto_create[RW]

Whether to automatically create validations based on database constraints. Boolean, default is true.

except[RW]

List of field names to exclude from automatic validation. Value is a single name, and array of names, or nil. Default is nil.

except_type[RW]

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.

only[RW]

List of field names to include in automatic validation. Value is a single name, and array of names, or nil. Default is nil.

only_type[RW]

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.

whitelist[RW]

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].

whitelist_type[RW]

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.