activeinteractor 2.0.0.alpha.4.0.1 → 2.0.0.alpha.4.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc451865dfb531e53701af2784f24db10856e07edff20046bd034c389e959121
4
- data.tar.gz: cfc832189a947dc7be86b9ae84e7cc933ae5220e8d2ce83bc0ce3a3e8a45f529
3
+ metadata.gz: 6a5bb6ce4f039c83c87fa2c01a29aaad3cdc276c1a48b0a433e699b627f5aaae
4
+ data.tar.gz: f45cfc0cbe14665aff305a9b0ede036b64a447c3d585e5eafa0896bbbc1e7494
5
5
  SHA512:
6
- metadata.gz: 59502fe574c00069b29558599baaf545201e7a48a4d7439bbafa5ee7f2a3eb3ba797346f086d18956fd28369bb712b6c137dfc977fdce2d6e1eac043a7eae0de
7
- data.tar.gz: 79bc149020a1cbf36090a1937de49689312e2b62a1001e4d06e4e0d6cf83557876009416ab9fe5d839520610dfbd3989cbc4c4cdcb7758ed18942a2f0e8ef23d
6
+ metadata.gz: ef7083fa64b332bd655a8f11522626c073c1c24f54e74005c6ab6a2072bd497129ba2a4419ac58b38816c170661b682f5b7032f35889e4243663c6bcc874ea44
7
+ data.tar.gz: f8528ce1dd53b532450c280d2e87ef97980f19571ba978c7f109583ea7934978a3b7b280ab10c01c1d89ab2b6baae436109b9b23e9fa041b6bfa56f40169fcee
data/CHANGELOG.md CHANGED
@@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning].
27
27
 
28
28
  ## [v1.2.0] - 2022-09-08
29
29
 
30
-
30
+ ### Added
31
31
 
32
32
  - `ActiveInteractor::Base.defer_after_callbacks_when_organized`
33
33
  - `ActiveInteractor::Organizer::Base.after_all_perform`
@@ -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.1
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-01-09 00:00:00.000000000 Z
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.1/CHANGELOG.md
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.1
95
- documentation_uri: https://activeinteractor.org/api/activeinteractor/v2.0.0-alpha.4.0.1
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