substance 0.26.0.2 → 0.27.1

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: db4e95d7f330b7ac29bdd857017b427defc87f0ad9796fec42bc63efa3cdb485
4
- data.tar.gz: 14b97d6b1687f5620836a7937af9046af9969149bfffc7741fb4c944e411d348
3
+ metadata.gz: 795bb2103775f30f6d314d8614077535d6ae0e11ea9f891724c55e7e88a817cb
4
+ data.tar.gz: 3d2ae3017cedf66ae0aaa3161ab48814ddadfc342bbef1c9acc6c74a0bc50492
5
5
  SHA512:
6
- metadata.gz: 597f3c854d96eba40a7edea903137bf395b95c1dd1e76e58965251c1e0ca58e9e86da8e2ef0885ac4b3d7f782a7c78dd1a1cb6e18e2f1900d0dfbc51d6879322
7
- data.tar.gz: f206aa732c3e7d3f10b5bfd0b726be2f812a8c82a2c1294dd318fc27311fd097dea82a021c10446656a5fe9c8b03ef98c9600d010a5f075719a75c258cce68a3
6
+ metadata.gz: 0c2e8dec05d80738715d63fcf610e7c458c62b1a636685d73eacca741dc44b11ee94dca6447121b2624719286ed996bced33c7bd63d8489c87d819c5faa77555
7
+ data.tar.gz: 5ff6c47d7b7eb981b8bc00e53847ed8d55ee8bdbedd876b7cdaee57b7c6bdf66e992cac1b411c94cab45d479c6ab26f1afc0a61dd9684bf4c99f5498d5301ed5
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_model"
4
+
3
5
  require_relative "input_object"
4
6
 
5
7
  module Substance
@@ -39,7 +39,7 @@ module Substance
39
39
 
40
40
  def ensure_validation_before(method)
41
41
  around_method method do |*args, **opts|
42
- raise NotValidatedError unless validated?
42
+ raise NotValidatedError unless validated_output?(method)
43
43
 
44
44
  # TODO: replace with `super(...)` when <= 2.6 support is dropped
45
45
  if RUBY_VERSION < "2.7" && opts.blank?
@@ -60,6 +60,14 @@ module Substance
60
60
  def output_struct
61
61
  Struct.new(*_outputs)
62
62
  end
63
+
64
+ def validated_output?(method)
65
+ validated? || begin
66
+ attr_name = method.to_s.delete("=").to_sym
67
+
68
+ _options.include?(attr_name) || _arguments.include?(attr_name)
69
+ end
70
+ end
63
71
  end
64
72
  end
65
73
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Substance
4
4
  # This constant is managed by spicerack
5
- VERSION = "0.26.0.2"
5
+ VERSION = "0.27.1"
6
6
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: substance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0.2
4
+ version: 0.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Freshly Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-28 00:00:00.000000000 Z
11
+ date: 2021-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activemodel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 5.2.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 5.2.1
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: activesupport
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -30,42 +44,42 @@ dependencies:
30
44
  requirements:
31
45
  - - '='
32
46
  - !ruby/object:Gem::Version
33
- version: 0.26.0.2
47
+ version: 0.27.1
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - '='
39
53
  - !ruby/object:Gem::Version
40
- version: 0.26.0.2
54
+ version: 0.27.1
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: tablesalt
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - '='
46
60
  - !ruby/object:Gem::Version
47
- version: 0.26.0.2
61
+ version: 0.27.1
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - '='
53
67
  - !ruby/object:Gem::Version
54
- version: 0.26.0.2
68
+ version: 0.27.1
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: technologic
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - '='
60
74
  - !ruby/object:Gem::Version
61
- version: 0.26.0.2
75
+ version: 0.27.1
62
76
  type: :runtime
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - '='
67
81
  - !ruby/object:Gem::Version
68
- version: 0.26.0.2
82
+ version: 0.27.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: faker
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -222,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
236
  - !ruby/object:Gem::Version
223
237
  version: '0'
224
238
  requirements: []
225
- rubygems_version: 3.1.6
239
+ rubygems_version: 3.2.26
226
240
  signing_key:
227
241
  specification_version: 4
228
242
  summary: Base classes for building powerful service objects