global_uid 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/global_uid/server.rb +22 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98380377dabc356230fb10d765ea683777d64e89626597fd030c848f4e3e2048
|
4
|
+
data.tar.gz: c361fed08769004591c58f40ca4b79d67f6aec19e0e1f22d2bb357f9392edc55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0298584b7b7a01105723caffe1770b4c1a448798335f38a2de67cce712031d9232267f4fdefba1fc7e2d642ec624c750e5b6b24d5ea1c0e57639fc40af588015'
|
7
|
+
data.tar.gz: 7f69e85213c62c30b14679993fc86eedf58e737b31557812a3de53a607f246b755287ddf9ded039836069cf3ed41572acf341ed298bfba56f23c5ccc84d76f92
|
data/lib/global_uid/server.rb
CHANGED
@@ -93,11 +93,7 @@ module GlobalUid
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def mysql2_connection(name)
|
96
|
-
|
97
|
-
config = ActiveRecord::Base.configurations.to_h[name]
|
98
|
-
c = config.symbolize_keys
|
99
|
-
|
100
|
-
raise "No global_uid support for adapter #{c[:adapter]}" if c[:adapter] != 'mysql2'
|
96
|
+
config = mysql2_config(name)
|
101
97
|
|
102
98
|
Timeout.timeout(connection_timeout, ConnectionTimeoutException) do
|
103
99
|
ActiveRecord::Base.mysql2_connection(config)
|
@@ -110,6 +106,27 @@ module GlobalUid
|
|
110
106
|
nil
|
111
107
|
end
|
112
108
|
|
109
|
+
if ActiveRecord.version < Gem::Version.new('6.1.0')
|
110
|
+
def mysql2_config(name)
|
111
|
+
raise "No id server '#{name}' configured in database.yml" unless ActiveRecord::Base.configurations.to_h.has_key?(name)
|
112
|
+
config = ActiveRecord::Base.configurations.to_h[name]
|
113
|
+
|
114
|
+
c = config.symbolize_keys
|
115
|
+
raise "No global_uid support for adapter #{c[:adapter]}" if c[:adapter] != 'mysql2'
|
116
|
+
|
117
|
+
config
|
118
|
+
end
|
119
|
+
else
|
120
|
+
def mysql2_config(name)
|
121
|
+
config = ActiveRecord::Base.configurations.configs_for(env_name: name, name: 'primary')
|
122
|
+
|
123
|
+
raise "No id server '#{name}' configured in database.yml" if config.nil?
|
124
|
+
raise "No global_uid support for adapter #{config.adapter}" if config.adapter != 'mysql2'
|
125
|
+
|
126
|
+
config.configuration_hash
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
113
130
|
def validate_connection_increment
|
114
131
|
db_increment = connection.select_value("SELECT @@auto_increment_increment")
|
115
132
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: global_uid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Quorning
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-01-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activerecord
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: 4.2.0
|
23
23
|
- - "<"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: '6.
|
25
|
+
version: '6.2'
|
26
26
|
type: :runtime
|
27
27
|
prerelease: false
|
28
28
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 4.2.0
|
33
33
|
- - "<"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '6.
|
35
|
+
version: '6.2'
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: activesupport
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
240
|
- !ruby/object:Gem::Version
|
241
241
|
version: '0'
|
242
242
|
requirements: []
|
243
|
-
rubygems_version: 3.
|
243
|
+
rubygems_version: 3.2.2
|
244
244
|
signing_key:
|
245
245
|
specification_version: 4
|
246
246
|
summary: GUID
|