Module: SchemaValidations::ActiveRecord::Validations

Defined in:
lib/schema_validations/active_record/validations.rb

Instance Method Summary collapse

Instance Method Details

#define_attribute_methodsObject

:nodoc:



17
18
19
20
# File 'lib/schema_validations/active_record/validations.rb', line 17

def define_attribute_methods(*) #:nodoc:
  super
  load_schema_validations
end

#schema_validations(opts) ⇒ Object

Per-model override of Config options. Use via, e.g.

class MyModel < ActiveRecord::Base
    schema_associations :auto_create => false
end


9
10
11
# File 'lib/schema_validations/active_record/validations.rb', line 9

def schema_validations(opts)
  @schema_validations_config = SchemaValidations.config.merge(opts)
end

#schema_validations_configObject

:nodoc:



13
14
15
# File 'lib/schema_validations/active_record/validations.rb', line 13

def schema_validations_config # :nodoc:
  @schema_validations_config ||= SchemaValidations.config.dup
end