octoball 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/octoball/association.rb +4 -1
- data/lib/octoball/relation_proxy.rb +1 -1
- data/lib/octoball/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: bb7caa27776a9d9ab8f6136f4a82544be12783a5efb1802e9a2a0b4dfb7f2c61
|
4
|
+
data.tar.gz: 818225f81822a0b77d4a5bc18ffdd6a11373ae47c6142a22ef8f7de23f61dc4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8210244af4c7d1cbd92693f89bb68c6a3ed978457d51bbfa9e1d4fb5a6b6ec498649d01d0eb70eb1ba9ae0ea350f0914b05756b275381a6244011fb95f6226a
|
7
|
+
data.tar.gz: d19f93c68c99e8a0524f13a876f7c742715e7e8303c6d742cd4565837e13b511909312958a716bac1eb4ae22cc22b26b61ffd38c75b18831d5de8594ab9f475d
|
data/lib/octoball/association.rb
CHANGED
@@ -12,11 +12,14 @@ class Octoball
|
|
12
12
|
def #{method}(*args, &block)
|
13
13
|
shard = owner.current_shard
|
14
14
|
return super if !shard || shard == ActiveRecord::Base.current_shard
|
15
|
+
ret = nil
|
15
16
|
ActiveRecord::Base.connected_to(shard: shard, role: Octoball.current_role) do
|
16
17
|
ret = super
|
17
18
|
return ret unless ret.is_a?(::ActiveRecord::Relation) || ret.is_a?(::ActiveRecord::QueryMethods::WhereChain)
|
18
|
-
RelationProxy.new(ret, shard)
|
19
|
+
ret = RelationProxy.new(ret, shard)
|
20
|
+
nil # return nil to avoid loading relation
|
19
21
|
end
|
22
|
+
ret
|
20
23
|
end
|
21
24
|
ruby2_keywords(:#{method}) if respond_to?(:ruby2_keywords, true)
|
22
25
|
END
|
@@ -62,7 +62,7 @@ class Octoball
|
|
62
62
|
if mblock
|
63
63
|
ret = #{connected_to} { @rel.to_a }.#{method}(*margs, &mblock)
|
64
64
|
else
|
65
|
-
#{connected_to} { ret = @rel.#{method}(*margs, &mblock); nil } # return nil avoid loading relation
|
65
|
+
#{connected_to} { ret = @rel.#{method}(*margs, &mblock); nil } # return nil to avoid loading relation
|
66
66
|
end
|
67
67
|
#{postamble}
|
68
68
|
EOS
|
data/lib/octoball/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octoball
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomoki Sekiyama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|