simple-sql 0.5.20 → 0.5.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple/sql/connection_manager.rb +8 -6
- data/lib/simple/sql/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96995841ebed4baaca67fa39701958d3ccff3a36325400075b043eb1d7236de5
|
4
|
+
data.tar.gz: fc6ae8d35382e6c6d0aead1743ade7add236cc9e40e50d8f896f353a8e804b3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b22a609bcee2a0ad16d1026e586e4845757d63bef891cfa6f38f4ab6268bdf752a34cb5eb72b588e53ffd31c53080b922095e22a1b4556c0c1047fbd505265b
|
7
|
+
data.tar.gz: bf5dc5c752346705a75ab3274c96a4998012344af45400e76f2f00f5498ed676caa95ff70406654c3ce0d05cbeaabba3d4fd9350c1ee3a4c8bb256ba703e8bff
|
@@ -11,19 +11,21 @@ module Simple::SQL
|
|
11
11
|
extend self
|
12
12
|
|
13
13
|
def disconnect_all!
|
14
|
-
ActiveRecord::Base.connection_pool.disconnect!
|
15
|
-
|
16
|
-
connection_classes.
|
14
|
+
ActiveRecord::Base.connection_pool.disconnect! if ActiveRecord::Base.connected?
|
15
|
+
|
16
|
+
connection_classes = connection_class_by_url.values
|
17
|
+
connection_classes.select(&:connected?).map(&:connection_pool).each(&:disconnect!)
|
18
|
+
connection_class_by_url.clear
|
17
19
|
end
|
18
20
|
|
19
21
|
def connection_class(url)
|
20
|
-
|
22
|
+
connection_class_by_url[url] ||= create_connection_class(url)
|
21
23
|
end
|
22
24
|
|
23
25
|
private
|
24
26
|
|
25
|
-
def
|
26
|
-
@
|
27
|
+
def connection_class_by_url
|
28
|
+
@connection_class_by_url ||= {}
|
27
29
|
end
|
28
30
|
|
29
31
|
# ActiveRecord needs a class name in order to connect.
|
data/lib/simple/sql/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-sql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radiospiel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-07-
|
12
|
+
date: 2019-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pg_array_parser
|
@@ -269,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
269
|
- !ruby/object:Gem::Version
|
270
270
|
version: '0'
|
271
271
|
requirements: []
|
272
|
-
rubygems_version: 3.0.
|
272
|
+
rubygems_version: 3.0.4
|
273
273
|
signing_key:
|
274
274
|
specification_version: 4
|
275
275
|
summary: SQL with a simple interface
|