tako 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +13 -0
- data/Rakefile +0 -1
- data/gemfiles/rails_42.gemfile +6 -0
- data/gemfiles/rails_50.gemfile +5 -0
- data/gemfiles/rails_51.gemfile +5 -0
- data/gemfiles/rails_52.gemfile +5 -0
- data/gemfiles/rails_edge.gemfile +7 -0
- data/lib/tako/active_record_ext/association_relation.rb +26 -22
- data/lib/tako/active_record_ext/collection_association.rb +24 -20
- data/lib/tako/active_record_ext/collection_proxy.rb +28 -24
- data/lib/tako/version.rb +1 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35e7110f9ba9f2ebd33c07036b4dc366b1341e59
|
4
|
+
data.tar.gz: 1b79b49722ba608aff2f3a1d5c737b5cb50a1eef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96a5f2c3f545f976d261f54cf53575655d3daa9bfd7c52004bd3e106432264d3f231b2c933de84d202e04d717b3c9dc3db960466cc7b374d3cf7fcb2b03014a7
|
7
|
+
data.tar.gz: 1dcd48453db7c01125c93794abb54815ed8e883ba4dbd179a527651707b570fe15675b5a782a93a6edf1babaeeabb582d0d5097bd27e1c4af2ce738380c6f58a
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
3
|
- 2.3.0
|
4
|
+
- 2.4.1
|
5
|
+
- 2.5.0
|
6
|
+
gemfile:
|
7
|
+
- gemfiles/rails_42.gemfile
|
8
|
+
- gemfiles/rails_50.gemfile
|
9
|
+
- gemfiles/rails_51.gemfile
|
10
|
+
- gemfiles/rails_52.gemfile
|
11
|
+
- gemfiles/rails_edge.gemfile
|
12
|
+
matrix:
|
13
|
+
exclude:
|
14
|
+
# AR 6.0+ required CRuby 2.4.1+
|
15
|
+
- rvm: 2.3.0
|
16
|
+
gemfile: gemfiles/rails_edge.gemfile
|
4
17
|
before_install: gem install bundler -v 1.11.2
|
data/Rakefile
CHANGED
@@ -1,30 +1,34 @@
|
|
1
1
|
module Tako
|
2
2
|
module ActiveRecordExt
|
3
3
|
module AssociationRelation
|
4
|
+
SHARDED_METHODS = [
|
5
|
+
:any?,
|
6
|
+
:build,
|
7
|
+
:count,
|
8
|
+
:create,
|
9
|
+
:create!,
|
10
|
+
:delete,
|
11
|
+
:delete_all,
|
12
|
+
:destroy,
|
13
|
+
:destroy_all,
|
14
|
+
:empty?,
|
15
|
+
:find,
|
16
|
+
:first,
|
17
|
+
:include?,
|
18
|
+
:last,
|
19
|
+
:length,
|
20
|
+
:many?,
|
21
|
+
:pluck,
|
22
|
+
:select,
|
23
|
+
:size,
|
24
|
+
:sum,
|
25
|
+
:to_a,
|
26
|
+
:uniq,
|
27
|
+
] & ActiveRecord::AssociationRelation.public_instance_methods
|
28
|
+
|
4
29
|
def self.included(mod)
|
5
30
|
mod.extend(ShardedMethods)
|
6
|
-
mod.sharded_methods
|
7
|
-
:build,
|
8
|
-
:count,
|
9
|
-
:create,
|
10
|
-
:create!,
|
11
|
-
:delete,
|
12
|
-
:delete_all,
|
13
|
-
:destroy,
|
14
|
-
:destroy_all,
|
15
|
-
:empty?,
|
16
|
-
:find,
|
17
|
-
:first,
|
18
|
-
:include?,
|
19
|
-
:last,
|
20
|
-
:length,
|
21
|
-
:many?,
|
22
|
-
:pluck,
|
23
|
-
:select,
|
24
|
-
:size,
|
25
|
-
:sum,
|
26
|
-
:to_a,
|
27
|
-
:uniq
|
31
|
+
mod.sharded_methods *SHARDED_METHODS
|
28
32
|
end
|
29
33
|
|
30
34
|
def current_shard
|
@@ -1,28 +1,32 @@
|
|
1
1
|
module Tako
|
2
2
|
module ActiveRecordExt
|
3
3
|
module CollectionAssociation
|
4
|
+
SHARDED_METHODS = [
|
5
|
+
:reader,
|
6
|
+
:writer,
|
7
|
+
:ids_reader,
|
8
|
+
:ids_writer,
|
9
|
+
:create,
|
10
|
+
:create!,
|
11
|
+
:build,
|
12
|
+
:any?,
|
13
|
+
:count,
|
14
|
+
:empty?,
|
15
|
+
:first,
|
16
|
+
:include?,
|
17
|
+
:last,
|
18
|
+
:length,
|
19
|
+
:load_target,
|
20
|
+
:many?,
|
21
|
+
:reload,
|
22
|
+
:size,
|
23
|
+
:select,
|
24
|
+
:uniq,
|
25
|
+
] & ActiveRecord::Associations::CollectionAssociation.public_instance_methods
|
26
|
+
|
4
27
|
def self.included(mod)
|
5
28
|
mod.extend(ShardedMethods)
|
6
|
-
mod.sharded_methods
|
7
|
-
:writer,
|
8
|
-
:ids_reader,
|
9
|
-
:ids_writer,
|
10
|
-
:create,
|
11
|
-
:create!,
|
12
|
-
:build,
|
13
|
-
:any?,
|
14
|
-
:count,
|
15
|
-
:empty?,
|
16
|
-
:first,
|
17
|
-
:include?,
|
18
|
-
:last,
|
19
|
-
:length,
|
20
|
-
:load_target,
|
21
|
-
:many?,
|
22
|
-
:reload,
|
23
|
-
:size,
|
24
|
-
:select,
|
25
|
-
:uniq
|
29
|
+
mod.sharded_methods *SHARDED_METHODS
|
26
30
|
end
|
27
31
|
end
|
28
32
|
end
|
@@ -1,32 +1,36 @@
|
|
1
1
|
module Tako
|
2
2
|
module ActiveRecordExt
|
3
3
|
module CollectionProxy
|
4
|
+
SHARDED_METHODS = [
|
5
|
+
:any?,
|
6
|
+
:build,
|
7
|
+
:count,
|
8
|
+
:create,
|
9
|
+
:create!,
|
10
|
+
:concat,
|
11
|
+
:delete,
|
12
|
+
:delete_all,
|
13
|
+
:destroy,
|
14
|
+
:destroy_all,
|
15
|
+
:empty?,
|
16
|
+
:find,
|
17
|
+
:first,
|
18
|
+
:include?,
|
19
|
+
:last,
|
20
|
+
:length,
|
21
|
+
:many?,
|
22
|
+
:pluck,
|
23
|
+
:replace,
|
24
|
+
:select,
|
25
|
+
:size,
|
26
|
+
:sum,
|
27
|
+
:to_a,
|
28
|
+
:uniq,
|
29
|
+
] & ActiveRecord::Associations::CollectionProxy.public_instance_methods
|
30
|
+
|
4
31
|
def self.included(mod)
|
5
32
|
mod.extend(ShardedMethods)
|
6
|
-
mod.sharded_methods
|
7
|
-
:build,
|
8
|
-
:count,
|
9
|
-
:create,
|
10
|
-
:create!,
|
11
|
-
:concat,
|
12
|
-
:delete,
|
13
|
-
:delete_all,
|
14
|
-
:destroy,
|
15
|
-
:destroy_all,
|
16
|
-
:empty?,
|
17
|
-
:find,
|
18
|
-
:first,
|
19
|
-
:include?,
|
20
|
-
:last,
|
21
|
-
:length,
|
22
|
-
:many?,
|
23
|
-
:pluck,
|
24
|
-
:replace,
|
25
|
-
:select,
|
26
|
-
:size,
|
27
|
-
:sum,
|
28
|
-
:to_a,
|
29
|
-
:uniq
|
33
|
+
mod.sharded_methods *SHARDED_METHODS
|
30
34
|
end
|
31
35
|
|
32
36
|
def current_shard
|
data/lib/tako/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tako
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masashi AKISUE
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -112,6 +112,11 @@ files:
|
|
112
112
|
- bin/console
|
113
113
|
- bin/setup
|
114
114
|
- circle.yml
|
115
|
+
- gemfiles/rails_42.gemfile
|
116
|
+
- gemfiles/rails_50.gemfile
|
117
|
+
- gemfiles/rails_51.gemfile
|
118
|
+
- gemfiles/rails_52.gemfile
|
119
|
+
- gemfiles/rails_edge.gemfile
|
115
120
|
- lib/tako.rb
|
116
121
|
- lib/tako/active_record_ext.rb
|
117
122
|
- lib/tako/active_record_ext/association.rb
|
@@ -154,9 +159,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
159
|
version: '0'
|
155
160
|
requirements: []
|
156
161
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
162
|
+
rubygems_version: 2.6.13
|
158
163
|
signing_key:
|
159
164
|
specification_version: 4
|
160
165
|
summary: Provides Horizontal-sharing for ActiveRecord
|
161
166
|
test_files: []
|
162
|
-
has_rdoc:
|