business_flow 0.14.1 → 0.14.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/business_flow/step.rb +13 -8
- data/lib/business_flow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a36d386ed615b80fdfaab67a8c6b7a7817bdd04d
|
4
|
+
data.tar.gz: 492b752fcd273157fc60b59b2e73f19ccf3b3d3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d2ac2702a87052c75c07996b626141ab2c090362119b02853d6df7b4f5fc2796adf76ad0d8fc5dba52ec17e070c55ab83f4155524a6c985f0a9610368964cd8
|
7
|
+
data.tar.gz: 0174d7593e10b6871139eeeb3566371ea0086162eea5200c0f0d7c06fea017f73a296e65a7ce1acbfebea3411797c28d36d9b739cf0648921d3792cc8b1a386a
|
data/Gemfile.lock
CHANGED
data/lib/business_flow/step.rb
CHANGED
@@ -55,13 +55,18 @@ module BusinessFlow
|
|
55
55
|
# :reek:ManualDispatch Checking respond_to? is signficantly faster than
|
56
56
|
# eating the NoMethodError when grabbing our error object.
|
57
57
|
def errors?
|
58
|
-
@result.respond_to?(:errors?)
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
@result.
|
58
|
+
if @result.respond_to?(:errors?)
|
59
|
+
@result.errors?
|
60
|
+
# This is here to support ActiveRecord. We don't want to call valid?
|
61
|
+
# because that will run validations and a step may return a partially
|
62
|
+
# constructed model. By instead pulling out the errors instance variable
|
63
|
+
# we'll only merge errors if validations have already been run.
|
64
|
+
elsif @result.class.include?(ActiveModel::Validations) &&
|
65
|
+
@result.instance_variable_defined(:@errors)
|
66
|
+
@result.instance_variable_get(:@errors).present?
|
67
|
+
else
|
68
|
+
false
|
69
|
+
end
|
65
70
|
end
|
66
71
|
|
67
72
|
def output
|
@@ -82,7 +87,7 @@ module BusinessFlow
|
|
82
87
|
# :reek:ManualDispatch Checking respond_to? is signficantly faster than
|
83
88
|
# eating the NoMethodError when grabbing our error object.
|
84
89
|
def mergeable_errors?
|
85
|
-
@result.respond_to?(:errors) &&
|
90
|
+
@result.respond_to?(:errors) && errors?
|
86
91
|
end
|
87
92
|
|
88
93
|
def merge_errors_into(object)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: business_flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Scarborough
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|