Module: ActiveRecord::PropertybaseId::Patches

Defined in:
lib/activerecord/propertybase_id/patches.rb

Defined Under Namespace

Modules: AddPropertybaseIdColumn, AddReferencePropertybaseIdColumn, Migrations, ReferencesPropertybaseIdColumn

Constant Summary collapse

PB_ID_SQL_TYPE =
"char(#{::PropertybaseId.max_length})"

Class Method Summary collapse

Class Method Details

.apply!Object



57
58
59
60
61
62
63
64
65
# File 'lib/activerecord/propertybase_id/patches.rb', line 57

def self.apply!
  ActiveRecord::ConnectionAdapters::Table.send :include, Migrations if defined? ActiveRecord::ConnectionAdapters::Table
  ActiveRecord::ConnectionAdapters::Table.send :include, ReferencesPropertybaseIdColumn if defined? ActiveRecord::ConnectionAdapters::Table
  ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Migrations if defined? ActiveRecord::ConnectionAdapters::TableDefinition
  ActiveRecord::ConnectionAdapters::TableDefinition.send :include, ReferencesPropertybaseIdColumn if defined? ActiveRecord::ConnectionAdapters::TableDefinition
  ActiveRecord::ConnectionAdapters::AlterTable.send :include, AddPropertybaseIdColumn

  ActiveRecord::ConnectionAdapters::SchemaStatements.send :include, AddReferencePropertybaseIdColumn
end