servactory 2.6.0.rc1 → 2.6.0.rc3

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: ed5a30d8696509717be1bdd8bc4a1207f89e1b43e8cce695829d889480c162d9
4
- data.tar.gz: 2c4fc042d8a917428fb909829e6b9557a5b8bff94e6f0b7753c628a3795c851f
3
+ metadata.gz: 3681e7c5a5e02756f7df77333a0974264548b6060605073f02cdbe8a2c3d9f55
4
+ data.tar.gz: 63b0ea14ade5b473b44173832c3411a3ac0d12e52e87539b8c7a5200f4a86915
5
5
  SHA512:
6
- metadata.gz: '09d166769f1772395a40af0bdadf7f0278aab29e67c5dc2fe4f25bdbadb8a8941b60f70f6256fa6a85a2ef80b32f9162ef1f14b12bf14f0fed08268c2b034b67'
7
- data.tar.gz: 5a4fecc6ff9b62a9745a940bdfa18d37b943d9bc3f4e888b43a25d3c612e3285d9ae6cb5a523e198dabd2f5bd7de570cc937ea1d848f6548445f9368123a4a32
6
+ metadata.gz: cd344cbcfa248de3a6974b8fa28e5544678851a2d7bf11fa3964087fbf80bc54551450d654624477ff5cfd9f7d7705b69507e2ee6e2ab46450adf7616c331ebd
7
+ data.tar.gz: dfefd697f5808b020e0507748f97c96e2a674dbf8a04707943a39f6a220a26f1002a6eb47fee727e4cb04ee042b23b87e4cf98804b52b2a22859eea73ac59037
@@ -28,6 +28,8 @@ module Servactory
28
28
  child.config.action_shortcuts = config.action_shortcuts
29
29
  child.config.action_rescue_handlers = config.action_rescue_handlers
30
30
 
31
+ child.config.i18n_root_key = config.i18n_root_key
32
+
31
33
  child.config.predicate_methods_enabled = config.predicate_methods_enabled
32
34
  end
33
35
 
@@ -30,10 +30,10 @@ module Servactory
30
30
  validate_for!(values: value, option: option)
31
31
  end
32
32
 
33
- def validate_for!(values:, option:)
33
+ def validate_for!(values:, option:) # rubocop:disable Metrics/CyclomaticComplexity
34
34
  consists_of_types = Array(option.value)
35
35
 
36
- return [false, :required] if !consists_of_types.include?(NilClass) && !values.flatten.all?(&:present?)
36
+ return [false, :required] if !consists_of_types.include?(NilClass) && !values&.flatten&.all?(&:present?)
37
37
 
38
38
  return true if values.flatten.all? do |value|
39
39
  consists_of_types.include?(value.class)
@@ -84,6 +84,8 @@ module Servactory
84
84
  end
85
85
 
86
86
  def given_type_for(values:, option_value:)
87
+ return nil if values.nil?
88
+
87
89
  values.flatten.filter { |value| Array(option_value).exclude?(value.class) }.map(&:class).uniq.join(", ")
88
90
  end
89
91
  end
@@ -5,7 +5,7 @@ module Servactory
5
5
  MAJOR = 2
6
6
  MINOR = 6
7
7
  PATCH = 0
8
- PRE = "rc1"
8
+ PRE = "rc3"
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
11
11
  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: 2.6.0.rc1
4
+ version: 2.6.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-10 00:00:00.000000000 Z
11
+ date: 2024-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport