Class: ActiveRecord::Migration

Inherits:
Object
  • Object
show all
Defined in:
lib/wagons/extensions/migration.rb

Class Method Summary collapse

Class Method Details

.maintain_test_schema_with_wagons!Object

Extend maintain_test_schema! to include migrations of the current wagon to test or to make sure no wagon migrations are loaded when testing the main application.



7
8
9
10
11
12
13
14
15
# File 'lib/wagons/extensions/migration.rb', line 7

def maintain_test_schema_with_wagons!
  if Base.maintain_test_schema
    # set migrations paths to core only, wagon migrations are loaded separately
    Migrator.migrations_paths = Rails.application.paths['db/migrate'].to_a
    if app_needs_migration?
      suppress_messages { load_wagon_schema! }
    end
  end
end