servactory 1.5.1 → 1.5.2

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: 77f19d5b6971cbec1d9f9c5861d14cfe511d4bdcd7d4636349909d2fc66136cd
4
- data.tar.gz: a0db50ba89379e4de2155b3b3d4b574bf0284aa23ef672071f1f0afa74ec5fb5
3
+ metadata.gz: 2f9511d2fb9a463c46f04ba4e6f005b14f9048039524a1aed476ee1a4fa997ef
4
+ data.tar.gz: f5e03fa8943d3a5fd4735ec3817528202ce3b2e06106d81f0ad08fde2e4e4baf
5
5
  SHA512:
6
- metadata.gz: 33720d025d61d2874b17181a5aa6d9f74ac060f1bb606da70495426c431afc1fb0e9d4ffdb8575a389a9d675fa0a900ef96a769df6653cc478d2df27176e894a
7
- data.tar.gz: 7e2ec6b1c657b943154e2f41ca7b43fe45fb77bc172664811a48a6575e6459ae154759f800ce59d1b179f3ff760a0f8ebf6dd97f4a3eb67f78d094e9cf55870b
6
+ metadata.gz: 406a99f8386dc97033fd28231e8b11438aa8827878ee332b11efa43747b92f7fcc993b547413733651a93bc0d1f59f6799f4b7e70778038f685d91206ff35be9
7
+ data.tar.gz: 2895de4a4fc256dcec75cddaddc0ff92b70e9cf42de13309acde95447b0466d4afa8103d52b6ec66e219109065f7f9ffea022c7c41789e88383f32cf08a5e8bb
@@ -37,10 +37,13 @@ module Servactory
37
37
  end
38
38
 
39
39
  def check
40
- return if @input.inclusion[:in].include?(@value)
40
+ inclusion_in, message = @input.inclusion.values_at(:in, :message)
41
+
42
+ return if inclusion_in.nil?
43
+ return if inclusion_in.include?(@value)
41
44
 
42
45
  add_error(
43
- DEFAULT_MESSAGE,
46
+ message.presence || DEFAULT_MESSAGE,
44
47
  service_class_name: @context.class.name,
45
48
  input: @input,
46
49
  value: @value
@@ -17,6 +17,7 @@ module Servactory
17
17
  )
18
18
  @name = name
19
19
  @internal_name = as.present? ? as : name
20
+
20
21
  add_basic_options_with(type: type, options: options)
21
22
 
22
23
  collection_of_options.each do |option|
@@ -4,7 +4,7 @@ module Servactory
4
4
  module VERSION
5
5
  MAJOR = 1
6
6
  MINOR = 5
7
- PATCH = 1
7
+ PATCH = 2
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].join(".")
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servactory
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-20 00:00:00.000000000 Z
11
+ date: 2023-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport