rails-sharding 1.1.2 → 1.1.3

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: 57602c5018eb3d77a8a684949ffab67a73fed32f4a606e7c918f1cef8181e3b5
4
- data.tar.gz: bae0f706bbbc0cdc301451630cb781d6f63b39ab23a54fad8ec12d3e9178de25
3
+ metadata.gz: 96b5ada6418c66eb271dff04d02ffc221e4790016b0d37ac7cd46303df8c6753
4
+ data.tar.gz: 8937dffd4ac3233f435447ac0c2ef1aba837cd6f0ea86bf8e22a49cbdcb1161e
5
5
  SHA512:
6
- metadata.gz: 134c2e5e7f8967167aef8e923c114b203b39e3ad0799de21d503346ac69b358495e52dec898934b322e2baef977c5bd16a2a989e68471cb0972c90ff3a4b07a4
7
- data.tar.gz: 44b6700d349482e1d0fbd8d716299f821edd9fc9750bdffab746a949e0c80732e3747e8864f2594bdc79aa0abe40d73a9894c2712edacd12c33c454797be9235
6
+ metadata.gz: 23c77ba2a1b8d967054a8885c33e78fdbe39dfe89eeaff38ee0b2e7e5003e4e286e8b965ba560aae7d01dbbac3ba008149e732354f436206525bd724f561684f
7
+ data.tar.gz: 49ceb4e48cd139db5d197eddcf7dbc4511f8a6e2ab82a26ca3cc6f2065e7ee82d56d45389148f7268ee3d05b6ad7fb264dca81074858d4c1a0f36d4b444158e7
@@ -13,10 +13,11 @@ module Rails::Sharding
13
13
  ShardThreadRegistry.push_current_shard(shard_group, shard_name)
14
14
  yield
15
15
  ensure
16
+ was_connected_to_master = ShardThreadRegistry.connecting_to_master?
16
17
  shard_group, shard_name, connection_used = ShardThreadRegistry.pop_current_shard
17
18
 
18
- # shows warning to user
19
- if Config.no_connection_retrieved_warning && !connection_used
19
+ # shows warning to user (except when connected to master database)
20
+ if Config.no_connection_retrieved_warning && !connection_used && !was_connected_to_master
20
21
  puts "Warning: no connection to shard '#{shard_group}:#{shard_name}' was retrieved inside the using_shard block. Make sure you don't forget to include Rails::Sharding::ShardableModel to the models you want to be sharded. Disable this warning with Rails::Sharding::Config.no_connection_retrieved_warning = false."
21
22
  end
22
23
 
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Sharding
3
- VERSION = "1.1.2"
3
+ VERSION = "1.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-sharding
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique Gubert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-08 00:00:00.000000000 Z
11
+ date: 2020-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails