switchman 3.5.21 → 3.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1aea9491a7cf89144f7952499f7194d6a5e975959298300c308e7ff7d5d23137
4
- data.tar.gz: 62d4da92da4c56faa42681cfeed6f41d41a0dd004ded08501093036167d7f0c7
3
+ metadata.gz: 7b8f37e3e9356686e68928e3034b86fcdb79452298db7975fdfe31b7d228ab36
4
+ data.tar.gz: 816a19029c59204477283b61158f745b14133d3f8dc434eceef25bc1ed740f80
5
5
  SHA512:
6
- metadata.gz: b53e691f7bb0f31814133f17d0344538e193e13559bb5ffc2c9355dd5cadab146341f750d0588daf0c38b33c1a65be866ef3064f0162365050c0a875a48bf4ea
7
- data.tar.gz: 43eec8da243a69a386e3873208ac1d7d511ac703c44fce3c4bbb0c8efc000d59aafc9b9112c2874de8aaf698c5c4590bda5af48345d35d669422a794c93386f8
6
+ metadata.gz: d0c838541eb848ef29fae8dc953ae100f20aef45d5c6f2afa209e85206767d3ea05a199888365d40d42812c9e57d68e011c5e70304e8354d186534326b9afc3b
7
+ data.tar.gz: bb87d7587ba1feb3f5d5055bc33f889024ed9e92c266ab2cbfdc6d42c5862eb20ef3b65d917bb3e13cfd212ad2e0139cbb8715b8844dba006f886f1e8322d072
@@ -83,7 +83,7 @@ module Switchman
83
83
  config_or_env ||= if current_shard == ::Rails.env.to_sym && current_role == :primary
84
84
  :primary
85
85
  else
86
- "#{current_shard}/#{current_role}".to_sym
86
+ :"#{current_shard}/#{current_role}"
87
87
  end
88
88
 
89
89
  super(config_or_env)
@@ -131,7 +131,7 @@ module Switchman
131
131
  relation.select_values = columns
132
132
 
133
133
  result = if relation.where_clause.contradiction?
134
- ActiveRecord::Result.empty
134
+ ::ActiveRecord::Result.empty
135
135
  else
136
136
  skip_query_cache_if_necessary do
137
137
  klass.connection.select_all(relation, "#{klass.name} Ids", async: @async)
@@ -64,7 +64,7 @@ module Switchman
64
64
  end
65
65
 
66
66
  def tls_key
67
- "#{object_id}_shard".to_sym
67
+ :"#{object_id}_shard"
68
68
  end
69
69
  end
70
70
  end
@@ -58,10 +58,9 @@ module Switchman
58
58
  end
59
59
 
60
60
  %I[update_all delete_all].each do |method|
61
- arg_params = (RUBY_VERSION <= "2.8") ? "*args" : "*args, **kwargs"
62
61
  class_eval <<-RUBY, __FILE__, __LINE__ + 1
63
- def #{method}(#{arg_params})
64
- result = self.activate(unordered: true) { |relation| relation.call_super(#{method.inspect}, Relation, #{arg_params}) }
62
+ def #{method}(*args, **kwargs)
63
+ result = self.activate(unordered: true) { |relation| relation.call_super(#{method.inspect}, Relation, *args, **kwargs) }
65
64
  result = result.sum if result.is_a?(Array)
66
65
  result
67
66
  end
@@ -12,14 +12,8 @@ module Switchman
12
12
  method.super_method
13
13
  end
14
14
 
15
- if RUBY_VERSION <= "2.8"
16
- def call_super(method, above_module, *args, &block)
17
- super_method_above(method, above_module).call(*args, &block)
18
- end
19
- else
20
- def call_super(method, above_module, *args, **kwargs, &block)
21
- super_method_above(method, above_module).call(*args, **kwargs, &block)
22
- end
15
+ def call_super(method, above_module, ...)
16
+ super_method_above(method, above_module).call(...)
23
17
  end
24
18
  end
25
19
  end
@@ -13,9 +13,8 @@ module Switchman
13
13
  end
14
14
 
15
15
  %w[update_all delete_all].each do |method|
16
- arg_params = (RUBY_VERSION <= "2.8") ? "*args" : "*args, **kwargs"
17
16
  class_eval <<-RUBY, __FILE__, __LINE__ + 1
18
- def #{method}(#{arg_params})
17
+ def #{method}(*args, **kwargs)
19
18
  db = Shard.current(connection_class_for_self).database_server
20
19
  db.unguard { super }
21
20
  end
@@ -3,7 +3,7 @@
3
3
  module Switchman
4
4
  class ShardedInstrumenter < ::SimpleDelegator
5
5
  def initialize(instrumenter, shard_host)
6
- super instrumenter
6
+ super(instrumenter)
7
7
  @shard_host = shard_host
8
8
  end
9
9
 
@@ -23,7 +23,7 @@ module Switchman
23
23
  end
24
24
  }
25
25
  end
26
- super name, payload
26
+ super(name, payload)
27
27
  end
28
28
  end
29
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switchman
4
- VERSION = "3.5.21"
4
+ VERSION = "3.6.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.21
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-02-26 00:00:00.000000000 Z
13
+ date: 2024-03-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -297,14 +297,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
297
297
  requirements:
298
298
  - - ">="
299
299
  - !ruby/object:Gem::Version
300
- version: '2.7'
300
+ version: '3.0'
301
301
  required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  requirements:
303
303
  - - ">="
304
304
  - !ruby/object:Gem::Version
305
305
  version: '0'
306
306
  requirements: []
307
- rubygems_version: 3.1.6
307
+ rubygems_version: 3.2.33
308
308
  signing_key:
309
309
  specification_version: 4
310
310
  summary: Rails sharding magic