Module: ActiveRecord::CompatibleLegacyMigration

Defined in:
lib/active_record/compatible_legacy_migration.rb,
lib/active_record/compatible_legacy_migration/version.rb,
lib/active_record/compatible_legacy_migration/configuration.rb

Defined Under Namespace

Classes: Configuration

Constant Summary collapse

VERSION =
"0.1.2"

Class Method Summary collapse

Class Method Details

.configObject



7
8
9
# File 'lib/active_record/compatible_legacy_migration.rb', line 7

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

.configure {|config| ... } ⇒ Object

Yields:



11
12
13
# File 'lib/active_record/compatible_legacy_migration.rb', line 11

def self.configure
  yield config if block_given?
end

.migration_classObject



15
16
17
18
19
20
21
# File 'lib/active_record/compatible_legacy_migration.rb', line 15

def self.migration_class
  if ActiveRecord::VERSION::MAJOR >= 5
    ActiveRecord::Migration[config.default_version]
  else
    ActiveRecord::Migration
  end
end