top_n_loader 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -13
- data/README.md +1 -1
- data/lib/top_n_loader.rb +2 -2
- data/lib/top_n_loader/version.rb +1 -1
- data/top_n_loader.gemspec +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cefe4d1a0d3a7a285526c35c6ead450994578721eb35bbc350ba3fc1e6154d6
|
4
|
+
data.tar.gz: b143544e5f799dc35d174378512107fdb978cfb73392eca0f921ea304388bb5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00f8b8f8bcf82e7cdc376119a45258280a7c9dbcedf97b84331191ee1fd3a0e745137927eb60b36fff86e790078ac9622219a524e9b1e3deb1a724cd6d030182
|
7
|
+
data.tar.gz: 320a553062bec7fa8d4cd3428806fa30ffefcbc2fb141975076a9cd0895f50020b8c82741936a40d1c389921a67a326579cd7c55c870b25fc29d99e90cafd7b5
|
data/Gemfile.lock
CHANGED
@@ -1,28 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
top_n_loader (1.0.
|
4
|
+
top_n_loader (1.0.1)
|
5
5
|
activerecord
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (
|
11
|
-
activesupport (=
|
12
|
-
activerecord (
|
13
|
-
activemodel (=
|
14
|
-
activesupport (=
|
15
|
-
|
16
|
-
activesupport (5.2.3)
|
10
|
+
activemodel (6.0.2.1)
|
11
|
+
activesupport (= 6.0.2.1)
|
12
|
+
activerecord (6.0.2.1)
|
13
|
+
activemodel (= 6.0.2.1)
|
14
|
+
activesupport (= 6.0.2.1)
|
15
|
+
activesupport (6.0.2.1)
|
17
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
17
|
i18n (>= 0.7, < 2)
|
19
18
|
minitest (~> 5.1)
|
20
19
|
tzinfo (~> 1.1)
|
21
|
-
|
20
|
+
zeitwerk (~> 2.2)
|
22
21
|
coderay (1.1.2)
|
23
22
|
concurrent-ruby (1.1.5)
|
24
23
|
docile (1.1.5)
|
25
|
-
i18n (1.
|
24
|
+
i18n (1.7.0)
|
26
25
|
concurrent-ruby (~> 1.0)
|
27
26
|
json (2.1.0)
|
28
27
|
method_source (0.9.0)
|
@@ -36,10 +35,11 @@ GEM
|
|
36
35
|
json (>= 1.8, < 3)
|
37
36
|
simplecov-html (~> 0.10.0)
|
38
37
|
simplecov-html (0.10.2)
|
39
|
-
sqlite3 (1.
|
38
|
+
sqlite3 (1.4.2)
|
40
39
|
thread_safe (0.3.6)
|
41
|
-
tzinfo (1.2.
|
40
|
+
tzinfo (1.2.6)
|
42
41
|
thread_safe (~> 0.1)
|
42
|
+
zeitwerk (2.2.2)
|
43
43
|
|
44
44
|
PLATFORMS
|
45
45
|
ruby
|
@@ -54,4 +54,4 @@ DEPENDENCIES
|
|
54
54
|
top_n_loader!
|
55
55
|
|
56
56
|
BUNDLED WITH
|
57
|
-
1.
|
57
|
+
2.1.2
|
data/README.md
CHANGED
data/lib/top_n_loader.rb
CHANGED
@@ -10,7 +10,7 @@ module TopNLoader
|
|
10
10
|
return Hash.new { [] } if ids.empty? || limit.zero?
|
11
11
|
klass = base_klass.reflect_on_association(relation.to_sym).klass
|
12
12
|
order_option = { limit: limit, **parse_order(klass, order) }
|
13
|
-
sql = SQLBuilder.top_n_association_sql base_klass, klass, relation, order_option
|
13
|
+
sql = SQLBuilder.top_n_association_sql base_klass, klass, relation, **order_option
|
14
14
|
records = klass.find_by_sql([sql, ids])
|
15
15
|
format_result(records, klass: klass, **order_option)
|
16
16
|
end
|
@@ -32,7 +32,7 @@ module TopNLoader
|
|
32
32
|
**options
|
33
33
|
)
|
34
34
|
)
|
35
|
-
format_result records, options
|
35
|
+
format_result records, **options
|
36
36
|
end
|
37
37
|
|
38
38
|
private
|
data/lib/top_n_loader/version.rb
CHANGED
data/top_n_loader.gemspec
CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = %q{load top n records for each group}
|
12
12
|
spec.description = %q{load top n records for each group}
|
13
|
+
spec.homepage = "https://github.com/tompng/#{spec.name}"
|
13
14
|
spec.license = "MIT"
|
14
15
|
|
15
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: top_n_loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tompng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -128,7 +128,7 @@ files:
|
|
128
128
|
- lib/top_n_loader/sql_builder.rb
|
129
129
|
- lib/top_n_loader/version.rb
|
130
130
|
- top_n_loader.gemspec
|
131
|
-
homepage:
|
131
|
+
homepage: https://github.com/tompng/top_n_loader
|
132
132
|
licenses:
|
133
133
|
- MIT
|
134
134
|
metadata: {}
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.1.2
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: load top n records for each group
|