moonrope 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/moonrope/dsl/structure_dsl.rb +2 -1
- data/lib/moonrope/railtie.rb +0 -2
- data/lib/moonrope/structure.rb +7 -1
- data/lib/moonrope/structure_attribute.rb +1 -0
- data/lib/moonrope/version.rb +1 -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: daba7a2efd635f91a04eb69d14fcea60738c8be6
|
4
|
+
data.tar.gz: 79bfec85cd725a038f2922c38e69fedb4e3a1a85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d3ce17c2a410105909bd97ebbac3b8ee2e362c5945805772f02fe9f5038a42241d19cb5a2f9c9cabb71c753ee3a385becdd102e7ef10d13d51899702c515531
|
7
|
+
data.tar.gz: e44eb7bc43ea321a06f10549dd9e4551fd5d43a3a24e928590b669e63e3ba1b805b60f9b9734707d4635c7f0cfab6f9f6436b335a9edad6eeb1e5c2b099bb50b
|
@@ -49,7 +49,8 @@ module Moonrope
|
|
49
49
|
attribute.structure = options[:structure]
|
50
50
|
attribute.structure_opts = options[:structure_opts]
|
51
51
|
attribute.value_type = options[:type]
|
52
|
-
attribute.source_attribute = options[:
|
52
|
+
attribute.source_attribute = options[:source_attribute]
|
53
|
+
attribute.value = options[:value]
|
53
54
|
attribute.groups = @groups
|
54
55
|
attribute.conditions = @conditions
|
55
56
|
@structure.attributes[type] << attribute
|
data/lib/moonrope/railtie.rb
CHANGED
data/lib/moonrope/structure.rb
CHANGED
@@ -116,7 +116,13 @@ module Moonrope
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
value
|
119
|
+
if attribute.value.is_a?(Proc)
|
120
|
+
value = environment.instance_eval(&attribute.value)
|
121
|
+
elsif attribute.value
|
122
|
+
value = attribute.value
|
123
|
+
else
|
124
|
+
value = value_for_attribute(object, environment, attribute)
|
125
|
+
end
|
120
126
|
|
121
127
|
if attribute.groups.empty?
|
122
128
|
hash[attribute.name] = value
|
data/lib/moonrope/version.rb
CHANGED