activeinteractor 2.0.0.alpha.4.0.2 → 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: 49a99115eedcdbf3c20a4f9ae7a2689666a112c18242e8df780a1640ec4cbab6
4
- data.tar.gz: f44209f8fcba17ddd81add053d38754fee6103b0d3322b8cad78a4835ecfbd82
3
+ metadata.gz: 6a5bb6ce4f039c83c87fa2c01a29aaad3cdc276c1a48b0a433e699b627f5aaae
4
+ data.tar.gz: f45cfc0cbe14665aff305a9b0ede036b64a447c3d585e5eafa0896bbbc1e7494
5
5
  SHA512:
6
- metadata.gz: 19c71ea32681cce8f34838887e07f04d6cac8fa73a20506c52a269faf92c1613446da878fa5e95de3bab57860d1428242da24e68abb3890003a9db0e8a00155d
7
- data.tar.gz: 4379d708f16448046d760f85d3ab30643c380a9be12726e160e9540e20163da2692a1e813c6e439f479954e67aa923f42617e19c8791161244514429cbfa19a5
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
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.2
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-12 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.2/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.2
95
- documentation_uri: https://activeinteractor.org/api/activeinteractor/v2.0.0-alpha.4.0.2
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