simple-sql 0.4.25 → 0.4.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 212516c863114d35963af30fe9943acf50a6ffca984fed39c96b049eb35f0ebc
4
- data.tar.gz: 0bf1d84fef36bcc00775ee58fcedd8d8a2b023890888761ecf324bfe6f346a25
3
+ metadata.gz: be78e29ecfb20313a18803c0db7ba672e4885ae55aea0b95d4fe7ddf3e2756dc
4
+ data.tar.gz: 6f3d9166d534128a7dedf5cec597a1c4a56bc8d716d8ae143020068085211e4f
5
5
  SHA512:
6
- metadata.gz: b594ec8b0c3fa7a2e67316112a3a599f7a159f879d807f757d66e65aec229068cc24654487c1a0232bed3effa747885aa5bba5a5f6a438ba0261a4a1c95cdcdb
7
- data.tar.gz: 804aaf1368ccbdb14b7dfd7d6777ab21473a4ccd18e97b7be65017a4363e7e7f2084dd347f7d4b09370f482bf10b01983fa58c9342347628c98ace104b5e3db7
6
+ metadata.gz: 3152b319707373f12c484c003ba34048fd8a6e06d89f9ffebfa51b6d5fb1afbf5ca343aaf7341c3db162b91a604006f42da6cb92128c111b0d4d8e2b342c1985
7
+ data.tar.gz: 737c04854b9c74ba418555638bfcdacbceb516f168eb773b2f75906ed4e63652b12058203992522598934234c5604ffc69c3b5f8e0cd8935311210981b26bcb1
@@ -1,5 +1,5 @@
1
1
  module Simple
2
2
  module SQL
3
- VERSION = "0.4.25"
3
+ VERSION = "0.4.26"
4
4
  end
5
5
  end
data/lib/simple/sql.rb CHANGED
@@ -82,8 +82,15 @@ module Simple
82
82
  def connect!(database_url = :auto)
83
83
  database_url = Config.determine_url if database_url == :auto
84
84
 
85
+ if Thread.current[:"Simple::SQL.database_url"] == database_url
86
+ logger.debug "thread #{Thread.current.object_id}: already connected to #{database_url}"
87
+ return
88
+ end
89
+
85
90
  connection = Connection.pg_connection(database_url)
86
91
  self.connector = lambda { connection }
92
+
93
+ Thread.current[:"Simple::SQL.database_url"] = database_url
87
94
  end
88
95
 
89
96
  # disconnects the current connection.
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.4.25
4
+ version: 0.4.26
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: 2018-12-12 00:00:00.000000000 Z
12
+ date: 2018-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pg_array_parser