mm_eager_includer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongo_mapper/eager_includer.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a2b53daef38831cced735b204ed16a74d79d0ba
|
4
|
+
data.tar.gz: 0b542a3bc903aae212cd27a5e96735485af9cbcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ac23cb7d4027937faccd0891c886d152f8b5ad4422dcb138f0269943ff265e3f09b46e05f75ebfeeec08b40d5a0e1213223c9d0ecbd758b03c275718e36e727
|
7
|
+
data.tar.gz: fc655a00672ec6be81ab14f8a48e01ccd4fa4e471405de477f5cd042fc0c088eeb6d1a3cf22abeab4d86b995e88dccea9aaaaf36aa6d102909d51b74e3a37f1d
|
@@ -11,7 +11,7 @@ class MongoMapper::EagerIncluder
|
|
11
11
|
if record_or_records.is_a? Plucky::Query
|
12
12
|
raise "You must call `to_a` on `Plucky::Query` objects before passing to eager_include"
|
13
13
|
end
|
14
|
-
@records = Array(record_or_records)
|
14
|
+
@records = Array(record_or_records).dup
|
15
15
|
|
16
16
|
return if @records.length == 0
|
17
17
|
@association_name = association_name.to_sym
|
@@ -23,6 +23,7 @@ class MongoMapper::EagerIncluder
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def eager_include
|
26
|
+
# ignore records that have already had this assoication eager loaded
|
26
27
|
@records.reject! do |record|
|
27
28
|
record.instance_variable_defined?(instance_variable_name)
|
28
29
|
end
|