activeinteractor 2.0.0.alpha.4.0.1 → 2.0.0.alpha.4.0.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a5bb6ce4f039c83c87fa2c01a29aaad3cdc276c1a48b0a433e699b627f5aaae
|
4
|
+
data.tar.gz: f45cfc0cbe14665aff305a9b0ede036b64a447c3d585e5eafa0896bbbc1e7494
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef7083fa64b332bd655a8f11522626c073c1c24f54e74005c6ab6a2072bd497129ba2a4419ac58b38816c170661b682f5b7032f35889e4243663c6bcc874ea44
|
7
|
+
data.tar.gz: f8528ce1dd53b532450c280d2e87ef97980f19571ba978c7f109583ea7934978a3b7b280ab10c01c1d89ab2b6baae436109b9b23e9fa041b6bfa56f40169fcee
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,8 @@ module ActiveInteractor
|
|
8
8
|
include ActiveModel::Validations
|
9
9
|
include Type::DeclerationMethods
|
10
10
|
|
11
|
+
validate :validate_attributes!
|
12
|
+
|
11
13
|
class << self
|
12
14
|
def method_defined?(method_name)
|
13
15
|
attribute_set.attribute_names.include?(method_name.to_s.delete('=').to_sym) || super
|
@@ -78,6 +80,13 @@ module ActiveInteractor
|
|
78
80
|
|
79
81
|
super
|
80
82
|
end
|
83
|
+
|
84
|
+
def validate_attributes!
|
85
|
+
attribute_set.attributes.each do |attribute|
|
86
|
+
attribute.validate!
|
87
|
+
attribute.error_messages.each { |message| errors.add(attribute.name, message) }
|
88
|
+
end
|
89
|
+
end
|
81
90
|
end
|
82
91
|
end
|
83
92
|
end
|
@@ -242,8 +242,9 @@ module ActiveInteractor
|
|
242
242
|
end
|
243
243
|
|
244
244
|
def fail!(errors = {})
|
245
|
+
result = nil
|
246
|
+
|
245
247
|
run_callbacks :fail do
|
246
|
-
result = nil
|
247
248
|
with_notification(:rollback) do |payload|
|
248
249
|
perform_rollback unless @options.skip_rollback
|
249
250
|
result = Result.failure(data: @output, errors: errors)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeinteractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.alpha.4.0.
|
4
|
+
version: 2.0.0.alpha.4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Allen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -66,7 +66,6 @@ files:
|
|
66
66
|
- lib/active_interactor/context.rb
|
67
67
|
- lib/active_interactor/context/attribute.rb
|
68
68
|
- lib/active_interactor/context/attribute_set.rb
|
69
|
-
- lib/active_interactor/context/attribute_validation.rb
|
70
69
|
- lib/active_interactor/context/base.rb
|
71
70
|
- lib/active_interactor/context/input.rb
|
72
71
|
- lib/active_interactor/context/output.rb
|
@@ -89,10 +88,10 @@ licenses:
|
|
89
88
|
- MIT
|
90
89
|
metadata:
|
91
90
|
bug_tracker_uri: https://github.com/activeinteractor/activeinteractor/issues
|
92
|
-
changelog_uri: https://github.com/activeinteractor/activeinteractor/blob/v2.0.0-alpha.4.0.
|
91
|
+
changelog_uri: https://github.com/activeinteractor/activeinteractor/blob/v2.0.0-alpha.4.0.3/CHANGELOG.md
|
93
92
|
homepage_uri: https://activeinteractor.org
|
94
|
-
source_code_uri: https://github.com/activeinteractor/activeinteractor/tree/v2.0.0-alpha.4.0.
|
95
|
-
documentation_uri: https://activeinteractor.org/api/activeinteractor/v2.0.0-alpha.4.0.
|
93
|
+
source_code_uri: https://github.com/activeinteractor/activeinteractor/tree/v2.0.0-alpha.4.0.3
|
94
|
+
documentation_uri: https://activeinteractor.org/api/activeinteractor/v2.0.0-alpha.4.0.3
|
96
95
|
wiki_uri: https://github.com/activeinteractor/activeinteractor/wiki
|
97
96
|
rubygems_mfa_required: 'true'
|
98
97
|
post_install_message:
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActiveInteractor
|
4
|
-
module Context
|
5
|
-
module AttributeValidation
|
6
|
-
extend ActiveSupport::Concern
|
7
|
-
|
8
|
-
included do
|
9
|
-
validate :validate_attributes!
|
10
|
-
end
|
11
|
-
|
12
|
-
protected
|
13
|
-
|
14
|
-
def validate_attributes!
|
15
|
-
attribute_set.attributes.each do |attribute|
|
16
|
-
attribute.validate!
|
17
|
-
attribute.error_messages.each { |message| errors.add(attribute.name, message) }
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|