batch-loader 1.2.1 → 1.2.2
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 +21 -5
- data/CHANGELOG.md +5 -1
- data/README.md +3 -3
- data/graphql-1.7.gemfile +7 -0
- data/graphql-1.8.gemfile +7 -0
- data/lib/batch_loader/executor_proxy.rb +1 -1
- data/lib/batch_loader/version.rb +1 -1
- metadata +5 -4
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c89e0468fac3840ce82631d0a0f9ac61eeda081
|
4
|
+
data.tar.gz: ec6c5021e04a5bc067356305659325431caa2753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6551811eace7cb180cdea08c28b77695d8c243af3e6675e9da8d172645cab35ba51803f036359c4ecd8a6cc65a1ec2b95e2b1824f829c0454da2c0570748e396
|
7
|
+
data.tar.gz: 78c0481961a045060a64c155ddb196f125da805944014ad59052464fb7b3a884e41cd6462ab5ceb186931cbcbd1e210f61d963007e4af8f1124809a2ec698e62
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,7 +1,23 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
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/
|
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 |
|
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(
|
300
|
+
loader.call(comment.user_id) { |memo| memo << comment }
|
301
301
|
end
|
302
302
|
end
|
303
303
|
```
|
data/graphql-1.7.gemfile
ADDED
data/graphql-1.8.gemfile
ADDED
@@ -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 =
|
12
|
+
@block_hash_key = [block.source_location, key]
|
13
13
|
@global_executor = BatchLoader::Executor.ensure_current
|
14
14
|
end
|
15
15
|
|
data/lib/batch_loader/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.3.4
|