module ActiveRecord::Migration::TestHelper

Constants

CONNECTION_METHODS

Attributes

connection[R]
table_name[R]

Public Instance Methods

setup() click to toggle source
Calls superclass method
# File activerecord/test/cases/migration/helper.rb, line 19
def setup
  super
  @connection = ActiveRecord::Base.connection
  connection.create_table :test_models do |t|
    t.timestamps null: true
  end

  TestModel.reset_column_information
end
teardown() click to toggle source
Calls superclass method
# File activerecord/test/cases/migration/helper.rb, line 29
def teardown
  super
  TestModel.reset_table_name
  TestModel.reset_sequence_name
  connection.drop_table :test_models, if_exists: true
end