active_record_custom_preloader 0.4.1 → 0.4.2
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
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3ae2d7473982e7d6c8a0acb437c9035639b612a
|
4
|
+
data.tar.gz: 569cdbd12ef58432b9ec7943483a1ecc0e674b53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 739c08fcfd37f34beade62def759197b85ca34f64751aa0ee860b5b843689353cfb7ebc9e134b97d9807db78d410274e537275483a65396eeae6988df96ec1c8
|
7
|
+
data.tar.gz: b30be1a80b7fc0c691fca81178754dcad5674abd3dd1b05f54e9a0f118179b445196023892c00c69bc8de61bc334a3217088e559b8f966a36bcdda0654cea361
|
@@ -78,7 +78,7 @@ module ActiveRecordCustomPreloader
|
|
78
78
|
keys.size.times { conditions.push(condition_part) }
|
79
79
|
condition_sql = conditions.map { |condition| "(#{condition})" }.join(' OR ')
|
80
80
|
condition_bindings = keys.flatten
|
81
|
-
return
|
81
|
+
return {} if condition_sql.blank? || condition_bindings.empty?
|
82
82
|
associations = associations_scope.where(condition_sql, *condition_bindings).to_a
|
83
83
|
associations.group_by(&method(:association_foreign_keys))
|
84
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_custom_preloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Talakevich
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|