mongoid_includes 3.0.0 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/mongoid/includes/association/eager.rb +5 -1
- data/lib/mongoid/includes/version.rb +1 -1
- data/spec/mongo.log +7256 -26538
- data/spec/mongoid/includes/polymorphic_includes_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -5
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8d1edc191e71925a3462bf7016a3df71eca0d73c3257e805b1484b58ea5ecd9
|
4
|
+
data.tar.gz: 89b4566f274c31a0df1d61b34cc5f3c04dc8bc51718a6528987df2f3d5eb122c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2adc7ec100121a377091f850489cd60e0de8a6f5a0c55f506482fc0241c2a679297bd6c20dd017ce1b223c186d3067008ef2d4673bc827ba4e82e9f17e867fc
|
7
|
+
data.tar.gz: c8c5b23eef7064c2f7e9f8af75806c3507e385684202140653d21dc6bb1f8f57ee628bf9b4f013b3d647bc5558eaffa14931d1edd73efd249aacded0ed518ef1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## Mongoid::Includes 3.0.2 (2022-11-03) ##
|
2
|
+
|
3
|
+
* [perf: avoid queries when foreign keys are empty](https://github.com/ElMassimo/mongoid_includes/commit/9f4c0c8bf1560a319c663fae77015c638caec56b)
|
4
|
+
|
5
|
+
## Mongoid::Includes 3.0.1 (2022-11-03) ##
|
6
|
+
|
7
|
+
* Allow installing this library with Mongoid `8.0`.
|
8
|
+
|
1
9
|
## Mongoid::Includes 3.0.0 (2020-10-29) ##
|
2
10
|
|
3
11
|
* Add support for Mongoid `7.1`.
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Mongoid::Includes
|
|
5
5
|
[![Test Coverage](https://codeclimate.com/github/ElMassimo/mongoid_includes/badges/coverage.svg)](https://codeclimate.com/github/ElMassimo/mongoid_includes)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/ElMassimo/mongoid_includes.svg)](https://codeclimate.com/github/ElMassimo/mongoid_includes)
|
7
7
|
[![Inline docs](http://inch-ci.org/github/ElMassimo/mongoid_includes.svg)](http://inch-ci.org/github/ElMassimo/mongoid_includes)
|
8
|
-
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ElMassimo/mongoid_includes/blob/
|
8
|
+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ElMassimo/mongoid_includes/blob/main/LICENSE.txt)
|
9
9
|
|
10
10
|
`Mongoid::Includes` improves eager loading in Mongoid, supporting polymorphic associations, and nested eager loading.
|
11
11
|
|
@@ -9,7 +9,11 @@ module Mongoid
|
|
9
9
|
# Internal: Performs eager load and iterates over the preloaded documents
|
10
10
|
# for the current relation.
|
11
11
|
def each_loaded_document
|
12
|
-
|
12
|
+
foreign_key_values = keys_from_docs
|
13
|
+
|
14
|
+
return @association.klass.none if foreign_key_values.empty?
|
15
|
+
|
16
|
+
@association.load_documents_for(key, foreign_key_values).each do |doc|
|
13
17
|
yield doc
|
14
18
|
end
|
15
19
|
end
|