Module: DataMapper::Adapters

Defined in:
lib/dm-migrations/auto_migration.rb

Class Method Summary collapse

Class Method Details

.include_migration_api(const_name) ⇒ Object



198
199
200
201
202
203
204
205
206
207
# File 'lib/dm-migrations/auto_migration.rb', line 198

def self.include_migration_api(const_name)
  require auto_migration_extensions(const_name)
  if Migrations.const_defined?(const_name)
    adapter = const_get(const_name)
    adapter.send(:include, migration_module(const_name))
  end
rescue LoadError
  # Silently ignore the fact that no adapter extensions could be required
  # This means that the adapter in use doesn't support migrations
end

.migration_module(const_name) ⇒ Object



209
210
211
# File 'lib/dm-migrations/auto_migration.rb', line 209

def self.migration_module(const_name)
  Migrations.const_get(const_name)
end