switchman 3.3.0 → 3.3.1

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: 0730763611a9f47cf3b9a39d5e3a9969189067772c743bad82729c670d18e545
4
- data.tar.gz: 4136ab04f9eac6c48ae4ad7a70b284845f095e3fc4153a8d5a5023f2bc5e312d
3
+ metadata.gz: d0330d210ee4f44c8ceb3b66ba1536f5538c4a1efcd4a939d492ffa65602fca7
4
+ data.tar.gz: '0787f10b30acc34e0a5e48423c524d2db27b8b92dabd76bf567fb6631c0587c3'
5
5
  SHA512:
6
- metadata.gz: ad391b862e5428999a5260278e767dae4a1266eb99fd2bab18619b26302542d67d50fee3277ff27711ce4eaec68fbf5428773d17b03b7d235e501baeb06a1623
7
- data.tar.gz: 87cee001748bcea7ce0f46a4d673a2c7ac3aefb16b99f84d463fbaff3804a98cd53184dd271a3b19261f89baef91151d85728076b76484646d5be95af1f101cb
6
+ metadata.gz: 65e0cbb8c9015940209145aa229648fa763d999399053e9046b0b4a60e1aae1ebfe419983776364e7e2460ca2e0cc0021188d286a8da6a9d9c0a74bd59d1bbc2
7
+ data.tar.gz: db938a240af2ffb146453536d42db25d38ac13ca136b757d219fef46cf99476c0916beb65c8e06e2bc48067b94736d8f88b4c13519f85d99ec2b07fc423eccc9
@@ -58,9 +58,10 @@ 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'
61
62
  class_eval <<-RUBY, __FILE__, __LINE__ + 1
62
- def #{method}(*args)
63
- result = self.activate(unordered: true) { |relation| relation.call_super(#{method.inspect}, Relation, *args) }
63
+ def #{method}(#{arg_params})
64
+ result = self.activate(unordered: true) { |relation| relation.call_super(#{method.inspect}, Relation, #{arg_params}) }
64
65
  result = result.sum if result.is_a?(Array)
65
66
  result
66
67
  end
@@ -12,8 +12,14 @@ module Switchman
12
12
  method.super_method
13
13
  end
14
14
 
15
- def call_super(method, above_module, *args, &block)
16
- super_method_above(method, above_module).call(*args, &block)
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
17
23
  end
18
24
  end
19
25
  end
@@ -13,8 +13,9 @@ 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'
16
17
  class_eval <<-RUBY, __FILE__, __LINE__ + 1
17
- def #{method}(*args)
18
+ def #{method}(#{arg_params})
18
19
  db = Shard.current(connection_class_for_self).database_server
19
20
  db.unguard { super }
20
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switchman
4
- VERSION = '3.3.0'
4
+ VERSION = '3.3.1'
5
5
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  - James Williams
9
9
  - Jacob Fugal
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-12-08 00:00:00.000000000 Z
13
+ date: 2022-12-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -300,7 +300,7 @@ licenses:
300
300
  - MIT
301
301
  metadata:
302
302
  rubygems_mfa_required: 'true'
303
- post_install_message:
303
+ post_install_message:
304
304
  rdoc_options: []
305
305
  require_paths:
306
306
  - lib
@@ -315,8 +315,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
315
315
  - !ruby/object:Gem::Version
316
316
  version: '0'
317
317
  requirements: []
318
- rubygems_version: 3.1.6
319
- signing_key:
318
+ rubygems_version: 3.3.7
319
+ signing_key:
320
320
  specification_version: 4
321
321
  summary: Rails sharding magic
322
322
  test_files: []