Module: SchemaAssociations

Defined in:
lib/schema_associations.rb,
lib/schema_associations/version.rb,
lib/schema_associations/active_record/associations.rb

Defined Under Namespace

Modules: ActiveRecord Classes: Config

Constant Summary collapse

VERSION =
"1.3.0"

Class Method Summary collapse

Class Method Details

.configObject

Returns the global configuration, i.e., the singleton instance of Config



93
94
95
# File 'lib/schema_associations.rb', line 93

def self.config
  @config ||= Config.new
end

.setup {|config| ... } ⇒ Object

Initialization block is passed a global Config instance that can be used to configure SchemaAssociations behavior. E.g., if you want to disable automation creation associations put the following in config/initializers/schema_associations.rb :

SchemaAssociations.setup do |config|
   config.auto_create = false
end

Yields:



106
107
108
# File 'lib/schema_associations.rb', line 106

def self.setup # :yields: config
  yield config
end