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 +4 -4
- data/lib/rails/sharding/core.rb +3 -2
- data/lib/rails/sharding/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96b5ada6418c66eb271dff04d02ffc221e4790016b0d37ac7cd46303df8c6753
|
4
|
+
data.tar.gz: 8937dffd4ac3233f435447ac0c2ef1aba837cd6f0ea86bf8e22a49cbdcb1161e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23c77ba2a1b8d967054a8885c33e78fdbe39dfe89eeaff38ee0b2e7e5003e4e286e8b965ba560aae7d01dbbac3ba008149e732354f436206525bd724f561684f
|
7
|
+
data.tar.gz: 49ceb4e48cd139db5d197eddcf7dbc4511f8a6e2ab82a26ca3cc6f2065e7ee82d56d45389148f7268ee3d05b6ad7fb264dca81074858d4c1a0f36d4b444158e7
|
data/lib/rails/sharding/core.rb
CHANGED
@@ -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
|
|
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.
|
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:
|
11
|
+
date: 2020-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|