Sha256: fbfce9cc59a1cab9f238b28e050e7f41dc6b3623196433da106034912f0b738b

Contents?: true

Size: 904 Bytes

Versions: 1

Compression:

Stored size: 904 Bytes

Contents

require 'rubygems'
require 'bundler/setup'
require 'automigration'
require 'test/unit'
require 'rails'
require 'action_controller/railtie'
require 'active_record'

# fake rails application
class AutomigrateApplication < Rails::Application
  config.active_support.deprecation = :log
end
AutomigrateApplication.initialize!

# AR connection
ActiveRecord::Base.establish_connection(
  :adapter => 'postgresql',
  :database => 'automigration_test'
)

# whitelist attributes
ActiveRecord::Base.attr_accessible nil

# load test models
Dir[File.expand_path("../models/*.rb", __FILE__)].each do |file|
  require file
end

# prepare tables for test models
Automigration::Migrator.set_models_load_path([File.expand_path("../models", __FILE__)])
Automigration::Migrator.all_tables.each do |table|
  ActiveRecord::Base.connection.drop_table(table)
end
Automigration::Migrator.new(:skip_output => true).update_schema!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
automigration-0.2.1 test/test_helper.rb