sidekiq-activerecord-shard 0.1.0 → 0.1.1

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: f2e44ce2e8eb14ffe2a5d28c3e09ded3aab7e90b113be16e9599c483e24880c6
4
- data.tar.gz: '08cc893a7882520acd9a57e5d71e6166e635da77ca6c5e305e2789cf689c0a34'
3
+ metadata.gz: 758bc7c30968cfc3961024118a4e4dd4f0bbefd4d99995ad7465f05691bac4eb
4
+ data.tar.gz: ae47127827bf9933229f22a3e104b698e2591e79acbba39e929b2515220bdb98
5
5
  SHA512:
6
- metadata.gz: 6073afb41c1ff90745b5084e2a7482586c0fd7262d2152c42957635778cfdfd48fe5c343ebea5d69af721879d90f0a53923e7d8e58085c0d9ff61672a2c0075e
7
- data.tar.gz: 0ee0dd719e024ca5559e1b8ce70159c806775b7ea4f9ae7851874990857e379aa54c10018a79b69c28d9fc007e98f797f61c6d4a602b1569048f235e0af5dee4
6
+ metadata.gz: 17fcce8d7723e936f85bc1a8d15448dc7ce89035f29cfc0f1f0d9484bae5793adf66d01c05dc2e00af36e576d1a01e12810ad103d75215d3d269a7be79b59248
7
+ data.tar.gz: fafdc2936270b3bc3237baa794559632977c304c69c01ff8057d5c6ea0379c57df8771cf9a0d9e7f32cc28c16b5ab290167e76e03192ff8ac2c46d04813d3500
data/README.md CHANGED
@@ -23,10 +23,10 @@ Add follow code into `config/initializers/sidekiq-activerecord-shard.rb`:
23
23
  SidekiqActiveRecordShard.configure do
24
24
  self.selected_shard = -> do
25
25
  case Current.tenant_id
26
- when "company1"
27
- :company1
26
+ when "other"
27
+ :other
28
28
  else
29
- :default
29
+ :primary
30
30
  end
31
31
  end
32
32
  end
@@ -2,11 +2,11 @@ require "sidekiq"
2
2
 
3
3
  module SidekiqActiveRecordShard
4
4
  class Client
5
- include ::Sidekiq::ClientMiddleware
5
+ include Sidekiq::ClientMiddleware
6
6
 
7
7
  def call(_jobclass, job, _queue, _redis)
8
8
  # Store shard value in Job arguments
9
- job["_active_record_shard"] = SidekiqActiveRecordShard.selected_shard.call
9
+ job["_active_record_shard"] = SidekiqActiveRecordShard.config.selected_shard.call
10
10
  yield
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module SidekiqActiveRecordShard
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-activerecord-shard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee