7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/unit_record/disconnected_active_record.rb', line 7
def disconnect!(options = {})
return if disconnected?
establish_connection options.merge(:adapter => "unit_record")
if options[:stub_associations]
ActiveRecord::Base.send :include, UnitRecord::AssociationStubbing
end
Fixtures.disconnect!
UnitRecord.base_rails_test_class.disconnect!
ActiveRecord::Migration.verbose = false
ActiveRecord::Base.connection.change_strategy(:noop) do
load(RAILS_ROOT + "/db/schema.rb")
end
end
|