Module: SchemaValidations
- Defined in:
- lib/schema_validations.rb,
lib/schema_validations/railtie.rb,
lib/schema_validations/version.rb,
lib/schema_validations/active_record/type.rb,
lib/schema_validations/active_record/validations.rb,
lib/schema_validations/validators/not_nil_validator.rb
Defined Under Namespace
Modules: ActiveRecord, Validators Classes: Config, Railtie
Constant Summary collapse
- VERSION =
"2.3.0"
Class Method Summary collapse
-
.config ⇒ Object
Returns the global configuration, i.e., the singleton instance of Config.
-
.setup {|config| ... } ⇒ Object
Initialization block is passed a global Config instance that can be used to configure SchemaValidations behavior.
Class Method Details
.config ⇒ Object
Returns the global configuration, i.e., the singleton instance of Config
95 96 97 |
# File 'lib/schema_validations.rb', line 95 def self.config @config ||= Config.new end |
.setup {|config| ... } ⇒ Object
Initialization block is passed a global Config instance that can be used to configure SchemaValidations behavior. E.g., if you want to disable automation creation validations put the following in config/initializers/schema_validations.rb :
SchemaValidations.setup do |config|
config.auto_create = false
end
108 109 110 |
# File 'lib/schema_validations.rb', line 108 def self.setup # :yields: config yield config end |