db-switch 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/db-switch/active_record_base.rb +1 -5
- data/lib/db-switch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c65ba4f5b420e3e8cc86652c8608e65cc3175505
|
4
|
+
data.tar.gz: b5d1448c673c7448ce5b979cdc703103b7faa9b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63e17f88dfbcc98f01910baaebd71f833e75475c0fca01d1d79c9c77a9eaf086b758390a4aab9430a81e3c404abe5e792019ad17d1bd9cabcab335615478a637
|
7
|
+
data.tar.gz: c42fce42ef334723335254aad66be169b059b02f3eb1d8474044965a77aafb5fd96ca3cc2794df7acc0a312b61bb4cf766c1d7985e0eed1b3fbb480fba694812
|
@@ -7,7 +7,7 @@ module DbSwitch
|
|
7
7
|
if ActiveRecord::Base.connection_handler.connected?(connection_name.to_s).nil?
|
8
8
|
db_config =
|
9
9
|
ActiveRecord::Base.configurations[connection_name.to_s] ||
|
10
|
-
|
10
|
+
Rails.application.config.database_configuration[connection_name.to_s]
|
11
11
|
|
12
12
|
if db_config && db_config[Rails.env.to_s]
|
13
13
|
spec =
|
@@ -30,9 +30,5 @@ module DbSwitch
|
|
30
30
|
def connection_specification_name
|
31
31
|
db_switch_connection_name || super
|
32
32
|
end
|
33
|
-
|
34
|
-
def connection_configurations
|
35
|
-
@connection_configurations ||= YAML.load_file(Rails.root.join('config/database.yml'))
|
36
|
-
end
|
37
33
|
end
|
38
34
|
end
|
data/lib/db-switch/version.rb
CHANGED