Module: SchemaPlus::ForeignKeys

Defined in:
lib/schema_plus/foreign_keys/version.rb,
lib/schema_plus/foreign_keys/middleware/sql.rb,
lib/schema_plus/foreign_keys/middleware/model.rb,
lib/schema_plus/foreign_keys/middleware/mysql.rb,
lib/schema_plus/foreign_keys/middleware/dumper.rb,
lib/schema_plus/foreign_keys/active_record/base.rb,
lib/schema_plus/foreign_keys/middleware/migration.rb,
lib/schema_plus/foreign_keys/active_record/migration/command_recorder.rb,
lib/schema_plus/foreign_keys/active_record/connection_adapters/mysql2_adapter.rb,
lib/schema_plus/foreign_keys/active_record/connection_adapters/sqlite3_adapter.rb,
lib/schema_plus/foreign_keys/active_record/connection_adapters/abstract_adapter.rb,
lib/schema_plus/foreign_keys/active_record/connection_adapters/postgresql_adapter.rb,
lib/schema_plus/foreign_keys/active_record/connection_adapters/foreign_key_definition.rb,
lib/schema_plus/foreign_keys.rb

Defined Under Namespace

Modules: ActiveRecord, Middleware Classes: Config

Constant Summary collapse

VERSION =
"0.1.7"

Class Method Summary collapse

Class Method Details

.configObject

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


62
63
64
# File 'lib/schema_plus/foreign_keys.rb', line 62

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

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

Initialization block is passed a global Config instance that can be used to configure SchemaPlus::ForeignKeys behavior. E.g., put something like the following in config/initializers/schema_plus_foreign_keys.rb :

SchemaPlus::ForeignKeys.setup do |config|
   config.on_update = :cascade
end

Yields:


74
75
76
# File 'lib/schema_plus/foreign_keys.rb', line 74

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