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
Defined Under Namespace
Modules: ActiveRecord Classes: Config, Railtie
Constant Summary collapse
- VERSION =
"2.2.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
94 95 96 |
# File 'lib/schema_validations.rb', line 94 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
107 108 109 |
# File 'lib/schema_validations.rb', line 107 def self.setup # :yields: config yield config end |