batch-loader 1.2.1 → 1.2.2

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
  SHA1:
3
- metadata.gz: c9c2a37ad6f642d238140812bad2ec413e220c0d
4
- data.tar.gz: e57a956992150ef4578edb133075b4ac3b1eb741
3
+ metadata.gz: 0c89e0468fac3840ce82631d0a0f9ac61eeda081
4
+ data.tar.gz: ec6c5021e04a5bc067356305659325431caa2753
5
5
  SHA512:
6
- metadata.gz: 024e3fc9ad27f32668f38a83260ea9f642094518f94e26144559c06240a2fe9ebe236e6028678362218276d9da8f5a603a943c712e4cb0b160ab7b7573e6fb45
7
- data.tar.gz: 9caaea9dfeadb9d3534cf850a221a68a7296ced09c1f8aa2e5af8c13777c3eb3c2b1fae527a8d4fed351f7a38aa09a50baa1978b66c039d9acc2b77587495c6a
6
+ metadata.gz: 6551811eace7cb180cdea08c28b77695d8c243af3e6675e9da8d172645cab35ba51803f036359c4ecd8a6cc65a1ec2b95e2b1824f829c0454da2c0570748e396
7
+ data.tar.gz: 78c0481961a045060a64c155ddb196f125da805944014ad59052464fb7b3a884e41cd6462ab5ceb186931cbcbd1e210f61d963007e4af8f1124809a2ec698e62
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+ .ruby-version
@@ -1,7 +1,23 @@
1
1
  sudo: false
2
2
  language: ruby
3
- rvm:
4
- - 2.3.4
5
- env:
6
- - CI=true
7
- before_install: gem install bundler -v 1.15.3
3
+ before_install: gem install bundler -v 1.17.1
4
+ matrix:
5
+ include:
6
+ - gemfile: graphql-1.7.gemfile
7
+ env: GRAPHQL_RUBY_VERSION=1_7 CI=true
8
+ rvm: 2.3.8
9
+ - gemfile: graphql-1.8.gemfile
10
+ env: GRAPHQL_RUBY_VERSION=1_8 CI=true
11
+ rvm: 2.3.8
12
+ - gemfile: graphql-1.7.gemfile
13
+ env: GRAPHQL_RUBY_VERSION=1_7 CI=true
14
+ rvm: 2.4.5
15
+ - gemfile: graphql-1.8.gemfile
16
+ env: GRAPHQL_RUBY_VERSION=1_8 CI=true
17
+ rvm: 2.4.5
18
+ - gemfile: graphql-1.7.gemfile
19
+ env: GRAPHQL_RUBY_VERSION=1_7 CI=true
20
+ rvm: 2.5.3
21
+ - gemfile: graphql-1.8.gemfile
22
+ env: GRAPHQL_RUBY_VERSION=1_8 CI=true
23
+ rvm: 2.5.3
@@ -8,10 +8,14 @@ one of the following labels: `Added`, `Changed`, `Deprecated`,
8
8
  to manage the versions of this gem so
9
9
  that you can set version constraints properly.
10
10
 
11
- #### [Unreleased](https://github.com/exAspArk/batch-loader/compare/v1.2.1...HEAD)
11
+ #### [Unreleased](https://github.com/exAspArk/batch-loader/compare/v1.2.2...HEAD)
12
12
 
13
13
  * WIP
14
14
 
15
+ #### [v1.2.2](https://github.com/exAspArk/batch-loader/compare/v1.2.1...v1.2.2)
16
+
17
+ * `Fixed`: Identify item by `key` object instead of `key` string representation. [#27](https://github.com/exAspArk/batch-loader/pull/27)
18
+
15
19
  #### [v1.2.1](https://github.com/exAspArk/batch-loader/compare/v1.2.0...v1.2.1)
16
20
 
17
21
  * `Fixed`: Do not depend on `method_missing` for `respond_to?`. [#14](https://github.com/exAspArk/batch-loader/pull/14)
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/exAspArk/batch-loader.svg?branch=master)](https://travis-ci.org/exAspArk/batch-loader)
4
4
  [![Coverage Status](https://coveralls.io/repos/github/exAspArk/batch-loader/badge.svg)](https://coveralls.io/github/exAspArk/batch-loader)
5
- [![Code Climate](https://img.shields.io/codeclimate/github/exAspArk/batch-loader.svg)](https://codeclimate.com/github/exAspArk/batch-loader)
5
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/exAspArk/batch-loader.svg)](https://codeclimate.com/github/exAspArk/batch-loader/maintainability)
6
6
  [![Downloads](https://img.shields.io/gem/dt/batch-loader.svg)](https://rubygems.org/gems/batch-loader)
7
7
  [![Latest Version](https://img.shields.io/gem/v/batch-loader.svg)](https://rubygems.org/gems/batch-loader)
8
8
 
@@ -295,9 +295,9 @@ end
295
295
  For batches where the value is some kind of collection, such as an Array or Hash, `loader` also supports being called with a block, which yields the _current_ value, and returns the _next_ value. This is extremely useful for 1:Many relationships:
296
296
 
297
297
  ```ruby
298
- BatchLoader.for(user.id).batch(default_value: []) do |comment_ids, loader|
298
+ BatchLoader.for(user.id).batch(default_value: []) do |user_ids, loader|
299
299
  Comment.where(user_id: user_ids).each do |comment|
300
- loader.call(user.id) { |memo| memo << comment }
300
+ loader.call(comment.user_id) { |memo| memo << comment }
301
301
  end
302
302
  end
303
303
  ```
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'coveralls'
4
+
5
+ gem "graphql", "~> 1.7"
6
+
7
+ gemspec
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'coveralls'
4
+
5
+ gem "graphql", "~> 1.8"
6
+
7
+ gemspec
@@ -9,7 +9,7 @@ class BatchLoader
9
9
  def initialize(default_value, key, &block)
10
10
  @default_value = default_value
11
11
  @block = block
12
- @block_hash_key = "#{key}#{block.source_location}"
12
+ @block_hash_key = [block.source_location, key]
13
13
  @global_executor = BatchLoader::Executor.ensure_current
14
14
  end
15
15
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class BatchLoader
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batch-loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - exAspArk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-16 00:00:00.000000000 Z
11
+ date: 2018-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,7 +117,6 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
119
  - ".rspec"
120
- - ".ruby-version"
121
120
  - ".travis.yml"
122
121
  - CHANGELOG.md
123
122
  - CODE_OF_CONDUCT.md
@@ -128,6 +127,8 @@ files:
128
127
  - batch-loader.gemspec
129
128
  - bin/console
130
129
  - bin/setup
130
+ - graphql-1.7.gemfile
131
+ - graphql-1.8.gemfile
131
132
  - lib/batch-loader.rb
132
133
  - lib/batch_loader.rb
133
134
  - lib/batch_loader/executor.rb
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
156
  version: '0'
156
157
  requirements: []
157
158
  rubyforge_project:
158
- rubygems_version: 2.6.13
159
+ rubygems_version: 2.6.11
159
160
  signing_key:
160
161
  specification_version: 4
161
162
  summary: Powerful tool to avoid N+1 DB or HTTP queries
@@ -1 +0,0 @@
1
- 2.3.4