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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7332631d4be05cc147356b553f3c0c64fd0c9ac0
4
- data.tar.gz: fca0a9ad9712a1b1ec7a7d6018d38949ea85bc8d
3
+ metadata.gz: 0a2b53daef38831cced735b204ed16a74d79d0ba
4
+ data.tar.gz: 0b542a3bc903aae212cd27a5e96735485af9cbcf
5
5
  SHA512:
6
- metadata.gz: 1528a173b37634d5e4f27969344be8ab26b990ae3f61cbee9b46f9c7ec29cad335be327453825d686295cc836c08d568ecb99bfa40cfb46b63d83b0585850732
7
- data.tar.gz: b5fc7442713502e7bf4b4995a312668818c9edd9d6c7c2644b5d127a181be6e09e92e3341d19e72836cfbe623909dc160f24648a4346d3fb8e40b024a2786d40
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mm_eager_includer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Taylor