fixturize 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/fixturize.rb +8 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjdkZmY2MzI1ZWY2YjE2YjU4MzdlNWUwNWMwMjg3YzU3N2JmZjA0OQ==
4
+ NDc5MWIxMDQzMGRiM2VlMTg4MmU5NzM4MWYxYTY1MWE3N2E5OTRlZg==
5
5
  data.tar.gz: !binary |-
6
- YWY2NTBiZDQ3MTY4MjQ5ZTA3ZmIzMmQ3MjY5NGM5MTY5NjI2NjAwOA==
6
+ NmVhMTJhZmNhNWZmMTZkYzQ2NTU4YjI2Yzc4NzNjNjYyMjBhNTA2NA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTlmNDM5MjI4Nzc1ZDU3OWVkN2E5M2MwN2QwYWZiMzI1NjcyZGZkOGRiMWI0
10
- MDMzM2FhMzFhYjA2ZGRhYWM3NjViYWIzMTdjYTdkYTAzODIwMTVjMmUzMjg5
11
- MzJmYzIwODM1Njc1NWZmNTE1OGJkZWY1MzZjY2I3ZWQ3NDliYWE=
9
+ ZWVmY2I0OWU5NGE0YWFmMzZhOWYxMDJhM2M1NTFjOTk2NTk5Y2NiYjgxYjU2
10
+ MmNiNzAwZTYwZGYwMmY1NGQwZTJiMTUxYzdjYjI2M2IyODA5NTUxNWJmOTZl
11
+ NzU1MmQ2OGUxOGU1MjEyNjNmNGM4NGYyNDdhNTc0Y2Y2MTQ2Mjc=
12
12
  data.tar.gz: !binary |-
13
- MzVjMGI4NTg4NGU4OGE1NjVjYzNiODQyMTQ0ZTM3OTYwZDJlMmYyOTQ0N2U0
14
- MDZjNDUzMDVhNWJhNGY5MWY2NzY2MDhkMGJlMTlmN2FlMTUzODkyYjQwMmRm
15
- ZmY2Zjk0ZDNhM2QyMmY2YjYxN2UyMWExOTU4NDA2MzgwMDg4N2I=
13
+ NDU5YzE5OTJiYmZmMTU4NjhlYjljZjhhNWUyNGVjZGE3OGE2OWViM2Y5ODMz
14
+ MmFkOWI1Yjg2ZmU0ZTE3MzdmNWQyN2FhMjEyMWZlOTYxZGI5MGNjM2QwZTUy
15
+ Y2ZlZTQxNjljMDJmN2I1OWNjNTIwZGY2Y2VhNjczZWU5NzI5YjY=
@@ -66,7 +66,7 @@ class Fixturize
66
66
 
67
67
  # TODO: Use duck typing?
68
68
  if defined?(MongoMapper) && obj.kind_of?(MongoMapper::Document)
69
- collection.insert({
69
+ collection.insert_aliased_from_fixturize({
70
70
  :type => INSTRUMENT_IVARS,
71
71
  :name => current_instrumentation,
72
72
  :ivar => ivar,
@@ -113,17 +113,20 @@ class Fixturize
113
113
  name = name.to_s
114
114
  self.current_instrumentation = name
115
115
  db_instrumentations = collection.find({ :name => name, :type => INSTRUMENT_DATABASE }).to_a
116
- ivar_instrumentations = collection.find({ :name => name, :type => INSTRUMENT_IVARS }).to_a
117
116
 
118
- if db_instrumentations.any? || ivar_instrumentations.any?
117
+ if db_instrumentations.any?
119
118
  uninstall!
120
119
 
121
120
  db_instrumentations.each do |instrumentation|
122
121
  load_data_from(instrumentation)
123
122
  end
124
123
 
125
- ivar_instrumentations.each do |instrumentation|
126
- load_ivars_from(instrumentation, caller_of_block(block))
124
+ ivar_instrumentations = collection.find({ :name => name, :type => INSTRUMENT_IVARS }).to_a
125
+
126
+ if ivar_instrumentations.any?
127
+ ivar_instrumentations.each do |instrumentation|
128
+ load_ivars_from(instrumentation, caller_of_block(block))
129
+ end
127
130
  end
128
131
  else
129
132
  safe_install(&block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixturize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Taylor