Module: DataMapper::Adapters

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

Class Method Summary collapse

Class Method Details

.include_migration_api(const_name) ⇒ Object



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

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



211
212
213
# File 'lib/dm-migrations/auto_migration.rb', line 211

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