top_n_loader 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd29e09d74f26981a3772f7ac8871d7fe00bbaa736588f2de733acea20ad7bc5
4
- data.tar.gz: 19a89bc3aaf851949e203fd0c29402f0c99fa6d3b3ce40227b4c7faa39c95370
3
+ metadata.gz: 2cefe4d1a0d3a7a285526c35c6ead450994578721eb35bbc350ba3fc1e6154d6
4
+ data.tar.gz: b143544e5f799dc35d174378512107fdb978cfb73392eca0f921ea304388bb5a
5
5
  SHA512:
6
- metadata.gz: 42e80f413a55f32365bcc68425ae2d070f56a708387db2b91f867018604b1b20076e303ce07212369cb04cc86eb66632aa70fde0f932608199c6bfc31c363c8f
7
- data.tar.gz: bbbbe954a980640ad53014604198fed10ff1047e09e1850ae18b7cb304e38240029ce9e583cdbb634923ac2f99819789cc9eec7a06680a1e32f2bcf861e42402
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.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 (5.2.3)
11
- activesupport (= 5.2.3)
12
- activerecord (5.2.3)
13
- activemodel (= 5.2.3)
14
- activesupport (= 5.2.3)
15
- arel (>= 9.0)
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
- arel (9.0.0)
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.6.0)
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.3.13)
38
+ sqlite3 (1.4.2)
40
39
  thread_safe (0.3.6)
41
- tzinfo (1.2.5)
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.17.2
57
+ 2.1.2
data/README.md CHANGED
@@ -35,7 +35,7 @@ end
35
35
 
36
36
  ```ruby
37
37
  # Gemfile
38
- gem 'top_n_loader', github: 'tompng/top_n_loader'
38
+ gem 'top_n_loader'
39
39
  ```
40
40
 
41
41
  ```ruby
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
@@ -1,3 +1,3 @@
1
1
  module TopNLoader
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
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.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: 2019-05-11 00:00:00.000000000 Z
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.0.1
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