File tree 3 files changed +7
-9
lines changed
3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 32
32
}
33
33
}
34
34
35
+ puts "Testing with #{ ActiveRecord ::Base . configurations } "
36
+
35
37
# Configure ActiveRecord
36
38
ActiveRecord ::Migration . verbose = false
37
39
ActiveRecord ::Base . table_name_prefix = ENV [ 'DB_PREFIX' ] . to_s
38
40
ActiveRecord ::Base . table_name_suffix = ENV [ 'DB_SUFFIX' ] . to_s
39
41
ActiveRecord ::Base . establish_connection
40
42
41
43
def env_db
42
- @env_db ||= if ActiveRecord ::Base . respond_to? ( :connection_db_config )
43
- ActiveRecord ::Base . connection_db_config . adapter
44
- else
45
- ActiveRecord ::Base . connection_config [ :adapter ]
46
- end . to_sym
44
+ @env_db ||= ActiveRecord ::Base . connection_db_config . adapter . to_sym
47
45
end
48
46
49
47
# Use in specs to skip some tests
Original file line number Diff line number Diff line change 8
8
end
9
9
end
10
10
11
- describe " multi database support" do
11
+ describe ' multi database support' do
12
12
it 'should have a different connection for menu items' do
13
13
# These 2 models are in the same database
14
14
assert_equal Tag . connection , Metal . connection
20
20
# The hierarchy table is in the same database
21
21
assert_equal MenuItem . connection , MenuItemHierarchy . connection
22
22
end
23
-
24
- end
23
+ end
Original file line number Diff line number Diff line change 19
19
}
20
20
}
21
21
22
+ puts "Testing with #{ ActiveRecord ::Base . configurations } "
23
+
22
24
ENV [ 'WITH_ADVISORY_LOCK_PREFIX' ] ||= SecureRandom . hex
23
25
24
- ActiveRecord ::Base . establish_connection
25
26
26
27
def env_db
27
28
@env_db ||= ActiveRecord ::Base . connection_db_config . adapter . to_sym
You can’t perform that action at this time.
0 commit comments