Sha256: 7178d91a75079bfaee85ca6c36b2bf612257a387b149454baebbc6d9892c08e1

Contents?: true

Size: 503 Bytes

Versions: 2

Compression:

Stored size: 503 Bytes

Contents

module MigrationsHelper
  def run_migration(migration, directions)
    silence_stream($stdout) do
      Array.wrap(directions).each do |direction|
        migration.migrate(direction)
      end
    end
  end

  def migration_class
    if Rails::VERSION::MAJOR >= 5
      ::ActiveRecord::Migration[5.0]
    else
      ::ActiveRecord::Migration
    end
  end

  def connection
    @_connection ||= ActiveRecord::Base.connection
  end
end

RSpec.configure do |config|
  config.include MigrationsHelper
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fx-0.9.0 spec/support/migration_helpers.rb
fx-0.8.0 spec/support/migration_helpers.rb