Revert changes to maintain Geo database schema in tests

This will add a lot of overhead to running specs locally without
Spring. If specs failing locally the person should run `bin/rake
geo:db:test:prepare`.
parent 8a7bd1bf
......@@ -79,18 +79,4 @@ FactoryGirl::SyntaxRunner.class_eval do
include RSpec::Mocks::ExampleMethods
end
#
# Maintain Geo database schema in tests. Unfortunately, we cannot simply use
# ActiveRecord::Migration.maintain_test_schema! because it hardcodes the rake
# task name:
#
# https://github.com/rails/rails/blob/master/activerecord/lib/active_record/migration.rb#L585
#
FileUtils.cd Rails.root do
Geo::BaseRegistry.clear_all_connections!
system("bin/rake geo:db:test:prepare")
# Establish a new connection, the old database may be gone (db:test:prepare uses purge)
Geo::BaseRegistry.establish_connection(Rails.configuration.geo_database)
end
ActiveRecord::Migration.maintain_test_schema!
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment