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.
- checksums.yaml +8 -8
- data/lib/fixturize.rb +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDc5MWIxMDQzMGRiM2VlMTg4MmU5NzM4MWYxYTY1MWE3N2E5OTRlZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmVhMTJhZmNhNWZmMTZkYzQ2NTU4YjI2Yzc4NzNjNjYyMjBhNTA2NA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWVmY2I0OWU5NGE0YWFmMzZhOWYxMDJhM2M1NTFjOTk2NTk5Y2NiYjgxYjU2
|
10
|
+
MmNiNzAwZTYwZGYwMmY1NGQwZTJiMTUxYzdjYjI2M2IyODA5NTUxNWJmOTZl
|
11
|
+
NzU1MmQ2OGUxOGU1MjEyNjNmNGM4NGYyNDdhNTc0Y2Y2MTQ2Mjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDU5YzE5OTJiYmZmMTU4NjhlYjljZjhhNWUyNGVjZGE3OGE2OWViM2Y5ODMz
|
14
|
+
MmFkOWI1Yjg2ZmU0ZTE3MzdmNWQyN2FhMjEyMWZlOTYxZGI5MGNjM2QwZTUy
|
15
|
+
Y2ZlZTQxNjljMDJmN2I1OWNjNTIwZGY2Y2VhNjczZWU5NzI5YjY=
|
data/lib/fixturize.rb
CHANGED
@@ -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.
|
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?
|
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.
|
126
|
-
|
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)
|