business_flow 0.17.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/business_flow/dsl.rb +3 -4
- data/lib/business_flow/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: de67f6febd81cafad9dc618831c25f13fc47bf47
|
4
|
+
data.tar.gz: c3f745982ea849da535575836f3ea9ac31ecb54e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52a1483078f35828d7ddd598e81e9db4b7ed9db9b0738cb3d89b5f2aacc40e4527d97e3222bbc9d6de0594aa6f8bf3fb46078cd4b8499970c248ec842cdb6e62
|
7
|
+
data.tar.gz: 568e11be57404e0a91aae804f3215915e88de9b97480b8e11c41d772a239addd9a4c0ba220e377b2b9cfab7ca1c643783c6ada6d7b37ed38b07606ebd0daf009
|
data/Gemfile.lock
CHANGED
data/lib/business_flow/dsl.rb
CHANGED
@@ -75,7 +75,7 @@ module BusinessFlow
|
|
75
75
|
|
76
76
|
# Declares that you will expose a field to the outside world.
|
77
77
|
def provides(*fields)
|
78
|
-
@provides ||= FieldList.new([], PublicField, [self,
|
78
|
+
@provides ||= FieldList.new([], PublicField, [self, const_get(:Result)])
|
79
79
|
@result_copy ||= FROM_FLOW_PREAMBLE
|
80
80
|
@result_copy += fields.map { |field| "\n@#{field} = flow.#{field}" }
|
81
81
|
.join
|
@@ -147,14 +147,14 @@ module BusinessFlow
|
|
147
147
|
# We use instance_variable_get here instead of making it part of
|
148
148
|
# from_flow to ensure that we do not create the errors object unless
|
149
149
|
# we need it.
|
150
|
-
result =
|
150
|
+
result = const_get(:Result).new(flow.instance_variable_get(:@errors))
|
151
151
|
result.from_flow(flow) if @result_copy
|
152
152
|
result
|
153
153
|
end
|
154
154
|
|
155
155
|
def finalize_result_provider
|
156
156
|
return if @finalized_result_provider || !@result_copy
|
157
|
-
|
157
|
+
const_get(:Result).class_eval "#{@result_copy}\nend", __FILE__, __LINE__
|
158
158
|
@finalized_result_provider = true
|
159
159
|
end
|
160
160
|
|
@@ -227,7 +227,6 @@ module BusinessFlow
|
|
227
227
|
def self.included(klass)
|
228
228
|
klass.extend(ClassMethods)
|
229
229
|
klass.class_eval RESULT_DEF, __FILE__, __LINE__
|
230
|
-
klass.instance_variable_set(:@result_klass, klass.const_get(:Result))
|
231
230
|
klass.extend(ErrorSupport) unless klass.respond_to?(:human_attribute_name)
|
232
231
|
end
|
233
232
|
|