active_storage_validations 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a7b0998dd3938eee42be49dc3d831eaea8482001a0e03227f61cc0330050a3a1
|
|
4
|
+
data.tar.gz: 72a82d3965c026f118bd1d4bc7e0338a2313c43394f780577cbbe944356caf39
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0117ebfeed615802b45e4f341eea6e5676d8189e4a4bf81faa565e8e49f418142a7aa3466a6cd3f92761e029ff54f58298259ae390682649d5ad5950e52d787
|
|
7
|
+
data.tar.gz: e6ab73fe085110abe6b346e3eb837a59ca81b499707cdbf8df9773647feefd7b11ca4e5be03329226954a43756a5ceda9550169ff5402a6f275cfc7b4865f6b9
|
data/README.md
CHANGED
|
@@ -314,9 +314,9 @@ end
|
|
|
314
314
|
|
|
315
315
|
To run tests in root folder of gem:
|
|
316
316
|
|
|
317
|
-
* `BUNDLE_GEMFILE=gemfiles/rails_5_2.gemfile bundle exec rake test` to run for Rails 5.2
|
|
318
317
|
* `BUNDLE_GEMFILE=gemfiles/rails_6_0.gemfile bundle exec rake test` to run for Rails 6.0
|
|
319
318
|
* `BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle exec rake test` to run for Rails 6.1
|
|
319
|
+
* `BUNDLE_GEMFILE=gemfiles/rails_7_0.gemfile bundle exec rake test` to run for Rails 7.0
|
|
320
320
|
* `BUNDLE_GEMFILE=gemfiles/rails_next.gemfile bundle exec rake test` to run for Rails main branch
|
|
321
321
|
|
|
322
322
|
Snippet to run in console:
|
|
@@ -19,13 +19,11 @@ module ActiveStorageValidations
|
|
|
19
19
|
|
|
20
20
|
def allowing(*types)
|
|
21
21
|
@allowed_types = types.flatten
|
|
22
|
-
either_allowing_or_rejecting
|
|
23
22
|
self
|
|
24
23
|
end
|
|
25
24
|
|
|
26
25
|
def rejecting(*types)
|
|
27
26
|
@rejected_types = types.flatten
|
|
28
|
-
either_allowing_or_rejecting
|
|
29
27
|
self
|
|
30
28
|
end
|
|
31
29
|
|
|
@@ -52,12 +50,6 @@ module ActiveStorageValidations
|
|
|
52
50
|
|
|
53
51
|
protected
|
|
54
52
|
|
|
55
|
-
def either_allowing_or_rejecting
|
|
56
|
-
if @allowed_types && @rejected_types
|
|
57
|
-
raise ArgumentError, "You must specify either allowing or rejecting"
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
53
|
def responds_to_methods
|
|
62
54
|
@subject.respond_to?(@attribute_name) &&
|
|
63
55
|
@subject.public_send(@attribute_name).respond_to?(:attach) &&
|
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.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Igor Kasyanchuk
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-10-
|
|
11
|
+
date: 2022-10-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activejob
|
|
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
240
240
|
- !ruby/object:Gem::Version
|
|
241
241
|
version: '0'
|
|
242
242
|
requirements: []
|
|
243
|
-
rubygems_version: 3.
|
|
243
|
+
rubygems_version: 3.3.7
|
|
244
244
|
signing_key:
|
|
245
245
|
specification_version: 4
|
|
246
246
|
summary: Validations for Active Storage
|