Method: ActiveRecord::Migration#exec_migration

Defined in:
activerecord/lib/active_record/migration.rb

#exec_migration(conn, direction) ⇒ Object



985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
# File 'activerecord/lib/active_record/migration.rb', line 985

def exec_migration(conn, direction)
  @connection = conn
  if respond_to?(:change)
    if direction == :down
      revert { change }
    else
      change
    end
  else
    public_send(direction)
  end
ensure
  @connection = nil
  @execution_strategy = nil
end