eager_group 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 22abe02d6bafe11c49460a72d251e3686f007796
4
- data.tar.gz: c4df75c16f76a672fc4b6dcfea0f5fe80399c064
2
+ SHA256:
3
+ metadata.gz: 36652bc032832f5a84dc02733286cd156a3253b8c1ba3b1b9289fec7686745d7
4
+ data.tar.gz: da2a878d043e2a02abb5f64c6d1c679dd02fe02220ba6399f5312e1ee096f953
5
5
  SHA512:
6
- metadata.gz: 33cd73103c6cb2597a13e640b028b7c2bfc75982ed3746355b07b758cb3810f5923fdb7967a4e102591d0aa07b51453d0473be94c2d5b2036f123e9286395ddd
7
- data.tar.gz: 61e0c3121f8504b094e11807a0f377f16c406b26973feea5a631152d0437465131720c0586870cee4e54e5f748bc01f976d3c4da78562ff741e6575a0b663002
6
+ metadata.gz: b7b4aacb136f425da49b81bf4d34c4bb467abc940b05fb936bd364b6884a322330acdec85449008de6f64716adc461ffebcad7a4b760f58fb44187b6abd2f3ba
7
+ data.tar.gz: 550d2eb69a366f90227c15382e25044078731610caae901982478baef95935dd581fc3b2a3affa04c48cab92a340d84744c18aeb5cb0a865a083ea78cee7bd69
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Next Release
2
2
 
3
+ ## 0.6.1 (03/05/2018)
4
+
5
+ * Skip preload when association is empty
6
+
3
7
  ## 0.6.0 (12/15/2018)
4
8
 
5
9
  * Support hash as `eager_group` argument
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # EagerGroup
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/xinminlabs/eager_group.png)](http://travis-ci.org/xinminlabs/eager_group)
3
+ [![Build Status](https://secure.travis-ci.org/flyerhzm/eager_group.png)](http://travis-ci.org/flyerhzm/eager_group)
4
4
  [![AwesomeCode Status for
5
- xinminlabs/eager_group](https://awesomecode.io/projects/e5386790-9420-4003-831a-c9a8c8a48108/status)](https://awesomecode.io/repos/xinminlabs/eager_group)
5
+ flyerhzm/eager_group](https://awesomecode.io/projects/e5386790-9420-4003-831a-c9a8c8a48108/status)](https://awesomecode.io/repos/flyerhzm/eager_group)
6
6
 
7
- [More explaination on our blog](http://blog.xinminlabs.com/2015/06/29/eager_group/)
7
+ [More explaination on our blog](http://blog.flyerhzm.com/2015/06/29/eager_group/)
8
8
 
9
9
  Fix n+1 aggregate sql functions for rails, like
10
10
 
@@ -99,7 +99,10 @@ but it would not help you to fix n+1 aggregate sql issue.
99
99
 
100
100
  ## Advanced
101
101
 
102
- User.limit(10).includes(:posts).eager_group(posts: [:comments_average_rating, :approved_comments_count])
102
+ ```ruby
103
+ User.limit(10).includes(:posts).eager_group(posts: [:comments_average_rating, :approved_comments_count])
104
+ ```
105
+
103
106
 
104
107
  ## Benchmark
105
108
 
@@ -109,6 +112,6 @@ times faster, WOW!
109
112
 
110
113
  ## Contributing
111
114
 
112
- Bug reports and pull requests are welcome on GitHub at https://github.com/xinminlabs/eager_group.
115
+ Bug reports and pull requests are welcome on GitHub at https://github.com/flyerhzm/eager_group.
113
116
 
114
- [1]: https://github.com/xinminlabs/eager_group/blob/master/benchmark.rb
117
+ [1]: https://github.com/flyerhzm/eager_group/blob/master/benchmark.rb
data/eager_group.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.summary = 'Fix n+1 aggregate sql functions'
14
14
  spec.description = 'Fix n+1 aggregate sql functions for rails'
15
- spec.homepage = 'https://github.com/xinminlabs/eager_group'
15
+ spec.homepage = 'https://github.com/flyerhzm/eager_group'
16
16
 
17
17
  spec.license = 'MIT'
18
18
 
@@ -16,6 +16,7 @@ module EagerGroup
16
16
  if definition_key.is_a?(Hash)
17
17
  association_name, definition_key = *definition_key.first
18
18
  @records = @records.flat_map { |record| record.send(association_name) }
19
+ next if @records.empty?
19
20
  @klass = @records.first.class
20
21
  end
21
22
  record_ids = @records.map { |record| record.send(primary_key) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EagerGroup
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eager_group
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-15 00:00:00.000000000 Z
11
+ date: 2019-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -133,7 +133,7 @@ files:
133
133
  - lib/eager_group/definition.rb
134
134
  - lib/eager_group/preloader.rb
135
135
  - lib/eager_group/version.rb
136
- homepage: https://github.com/xinminlabs/eager_group
136
+ homepage: https://github.com/flyerhzm/eager_group
137
137
  licenses:
138
138
  - MIT
139
139
  metadata: {}
@@ -152,8 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubyforge_project:
156
- rubygems_version: 2.6.14
155
+ rubygems_version: 3.0.1
157
156
  signing_key:
158
157
  specification_version: 4
159
158
  summary: Fix n+1 aggregate sql functions