active_storage_validations 1.1.0 → 1.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b512ecda0ff1fa0f06649f78b7b4f58433ca7f108abd729ce08cd0eea2b1baf
|
4
|
+
data.tar.gz: 1ef72d050d31ed0d4052672370849c5d66538df5b06e5a477ebc3575fc110e40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc0392b8725f2a567df3f99b61c5053ab0870e877ba16f3085871842a70ca7f5db328b63b3275912017831d4ed29697a66106cdad4e7cfbb779a1985b7d20488
|
7
|
+
data.tar.gz: 8a6883ac4f1cbf0e703c41d1e8ddf6136397fb3973997cc37c83aef3f0456ab5278b5475518ce3ddb8a776a41c8e8f7774160850ddcb49b5ece6e9c846cab8db
|
@@ -35,7 +35,7 @@ module ActiveStorageValidations
|
|
35
35
|
|
36
36
|
def matches?(subject)
|
37
37
|
@subject = subject.is_a?(Class) ? subject.new : subject
|
38
|
-
responds_to_methods && allowed_types_allowed? && rejected_types_rejected? &&
|
38
|
+
responds_to_methods && allowed_types_allowed? && rejected_types_rejected? && validate_custom_message?
|
39
39
|
end
|
40
40
|
|
41
41
|
def failure_message
|
@@ -88,10 +88,12 @@ module ActiveStorageValidations
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
def
|
91
|
+
def validate_custom_message?
|
92
|
+
return true unless @custom_message
|
93
|
+
|
92
94
|
@subject.public_send(@attribute_name).attach(attachment_for('fake/fake'))
|
93
95
|
@subject.validate
|
94
|
-
@subject.errors.details[@attribute_name].all? do |error|
|
96
|
+
@subject.errors.details[@attribute_name].select{|error| error[:content_type]}.all? do |error|
|
95
97
|
error[:error].to_s.include?(error_message)
|
96
98
|
end
|
97
99
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_storage_validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Kasyanchuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|