active_storage_validations 0.9.2 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +35 -2
- data/config/locales/de.yml +5 -0
- data/config/locales/en.yml +0 -0
- data/config/locales/es.yml +2 -2
- data/config/locales/it.yml +22 -0
- data/config/locales/nl.yml +0 -0
- data/config/locales/pl.yml +22 -0
- data/config/locales/ru.yml +0 -0
- data/config/locales/uk.yml +0 -0
- data/config/locales/vi.yml +22 -0
- data/lib/active_storage_validations/aspect_ratio_validator.rb +1 -1
- data/lib/active_storage_validations/attached_validator.rb +4 -1
- data/lib/active_storage_validations/content_type_validator.rb +11 -6
- data/lib/active_storage_validations/dimension_validator.rb +1 -1
- data/lib/active_storage_validations/limit_validator.rb +0 -0
- data/lib/active_storage_validations/matchers/content_type_validator_matcher.rb +1 -1
- data/lib/active_storage_validations/matchers/dimension_validator_matcher.rb +8 -1
- data/lib/active_storage_validations/matchers/size_validator_matcher.rb +0 -0
- data/lib/active_storage_validations/matchers.rb +1 -1
- data/lib/active_storage_validations/metadata.rb +9 -10
- data/lib/active_storage_validations/size_validator.rb +11 -0
- data/lib/active_storage_validations/version.rb +1 -1
- data/lib/active_storage_validations.rb +0 -0
- metadata +49 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52bbd6249bbadd7549ccd7daf17673e98ccfd757b15ec954b67c5d7ce3395c84
|
4
|
+
data.tar.gz: cf3664efb821cd7fe60b0536e0d394f900af6fb128161ab13d62d373b2018013
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bece2608d56156a83e468ffaf4ed31dead1769882457c1ff8480586ce0335122b475084f24f914d4d8083c5b4f2b891bda7465b25b2d34272ba76631c313167f
|
7
|
+
data.tar.gz: 56a1cbb1bd5bddc4cce887405eecd6d5e27cc9bfcdca97e636ccf43cf98ce29d9077e1b3e7a602dcb229cd24d25125024c4d83beba6f82050edc773b32d21ca4
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Active Storage Validations
|
2
2
|
|
3
|
+
[![MiniTest](https://github.com/igorkasyanchuk/active_storage_validations/workflows/MiniTest/badge.svg)](https://github.com/igorkasyanchuk/active_storage_validations/actions)
|
4
|
+
[![RailsJazz](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/my_other.svg?raw=true)](https://www.railsjazz.com)
|
5
|
+
[![https://www.patreon.com/igorkasyanchuk](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/patron.svg?raw=true)](https://www.patreon.com/igorkasyanchuk)
|
6
|
+
|
3
7
|
If you are using `active_storage` gem and you want to add simple validations for it, like presence or content_type you need to write a custom validation method.
|
4
8
|
|
5
9
|
This gems doing it for you. Just use `attached: true` or `content_type: 'image/png'` validation.
|
@@ -54,14 +58,15 @@ end
|
|
54
58
|
|
55
59
|
### More examples
|
56
60
|
|
57
|
-
- Content type validation using symbols. In order to infer the correct mime type from the symbol, the types must be registered with `
|
61
|
+
- Content type validation using symbols. In order to infer the correct mime type from the symbol, the types must be registered with `Marcel::EXTENSIONS` (`MimeMagic::EXTENSIONS` for Rails <= 6.1.3).
|
58
62
|
|
59
63
|
```ruby
|
60
64
|
class User < ApplicationRecord
|
61
65
|
has_one_attached :avatar
|
62
66
|
has_many_attached :photos
|
63
67
|
|
64
|
-
validates :avatar, attached: true, content_type: :png #
|
68
|
+
validates :avatar, attached: true, content_type: :png # Marcel::Magic.by_extension(:png).to_s => 'image/png'
|
69
|
+
# Rails <= 6.1.3; MimeMagic.by_extension(:png).to_s => 'image/png'
|
65
70
|
# or
|
66
71
|
validates :photos, attached: true, content_type: [:png, :jpg, :jpeg]
|
67
72
|
# or
|
@@ -216,6 +221,7 @@ describe User do
|
|
216
221
|
|
217
222
|
it { is_expected.to validate_dimensions_of(:avatar).width(250) }
|
218
223
|
it { is_expected.to validate_dimensions_of(:avatar).height(200) }
|
224
|
+
it { is_expected.to validate_dimensions_of(:avatar).width(250).height(200).with_message('Invalid dimensions.') }
|
219
225
|
it { is_expected.to validate_dimensions_of(:avatar).width_min(200) }
|
220
226
|
it { is_expected.to validate_dimensions_of(:avatar).width_max(500) }
|
221
227
|
it { is_expected.to validate_dimensions_of(:avatar).height_min(100) }
|
@@ -257,6 +263,7 @@ class UserTest < ActiveSupport::TestCase
|
|
257
263
|
|
258
264
|
should validate_dimensions_of(:avatar).width(250)
|
259
265
|
should validate_dimensions_of(:avatar).height(200)
|
266
|
+
should validate_dimensions_of(:avatar).width(250).height(200).with_message('Invalid dimensions.')
|
260
267
|
should validate_dimensions_of(:avatar).width_min(200)
|
261
268
|
should validate_dimensions_of(:avatar).width_max(500)
|
262
269
|
should validate_dimensions_of(:avatar).height_min(100)
|
@@ -286,6 +293,20 @@ To run tests in root folder of gem:
|
|
286
293
|
* `BUNDLE_GEMFILE=gemfiles/rails_5_2.gemfile bundle exec rake test` to run for Rails 5.2
|
287
294
|
* `BUNDLE_GEMFILE=gemfiles/rails_6_0.gemfile bundle exec rake test` to run for Rails 6.0
|
288
295
|
* `BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle exec rake test` to run for Rails 6.1
|
296
|
+
* `BUNDLE_GEMFILE=gemfiles/rails_next.gemfile bundle exec rake test` to run for Rails main branch
|
297
|
+
|
298
|
+
Snippet to run in console:
|
299
|
+
|
300
|
+
```
|
301
|
+
BUNDLE_GEMFILE=gemfiles/rails_5_2.gemfile bundle
|
302
|
+
BUNDLE_GEMFILE=gemfiles/rails_6_0.gemfile bundle
|
303
|
+
BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle
|
304
|
+
BUNDLE_GEMFILE=gemfiles/rails_next.gemfile bundle
|
305
|
+
BUNDLE_GEMFILE=gemfiles/rails_5_2.gemfile bundle exec rake test
|
306
|
+
BUNDLE_GEMFILE=gemfiles/rails_6_0.gemfile bundle exec rake test
|
307
|
+
BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle exec rake test
|
308
|
+
BUNDLE_GEMFILE=gemfiles/rails_next.gemfile bundle exec rake test
|
309
|
+
```
|
289
310
|
|
290
311
|
## Known issues
|
291
312
|
|
@@ -332,7 +353,19 @@ You are welcome to contribute.
|
|
332
353
|
- https://github.com/molfar
|
333
354
|
- https://github.com/connorshea
|
334
355
|
- https://github.com/yshmarov
|
356
|
+
- https://github.com/fongfan999
|
357
|
+
- https://github.com/cooperka
|
358
|
+
- https://github.com/dolarsrg
|
359
|
+
- https://github.com/jayshepherd
|
360
|
+
- https://github.com/ohbarye
|
361
|
+
- https://github.com/randsina
|
362
|
+
- https://github.com/vietqhoang
|
363
|
+
- https://github.com/kemenaran
|
364
|
+
- https://github.com/jrmhaig
|
335
365
|
|
336
366
|
## License
|
337
367
|
|
338
368
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
369
|
+
|
370
|
+
[<img src="https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/more_gems.png?raw=true"
|
371
|
+
/>](https://www.railsjazz.com/)
|
data/config/locales/de.yml
CHANGED
@@ -15,3 +15,8 @@ de:
|
|
15
15
|
dimension_height_less_than_or_equal_to: "Höhe muss kleiner oder gleich %{length} Pixel sein"
|
16
16
|
dimension_width_equal_to: "Bildbreite muss genau %{length} Pixel sein"
|
17
17
|
dimension_height_equal_to: "Bildhöhe muss genau %{length} Pixel sein"
|
18
|
+
aspect_ratio_not_square: "muss quadratisch sein"
|
19
|
+
aspect_ratio_not_portrait: "muss Hochformat sein"
|
20
|
+
aspect_ratio_not_landscape: "muss Querformat sein"
|
21
|
+
aspect_ratio_is_not: "muss ein Bildseitenverhältnis von %{aspect_ratio} haben"
|
22
|
+
aspect_ratio_unknown: "hat ein unbekanntes Bildseitenverhältnis"
|
data/config/locales/en.yml
CHANGED
File without changes
|
data/config/locales/es.yml
CHANGED
@@ -16,7 +16,7 @@ es:
|
|
16
16
|
dimension_width_equal_to: "el ancho debe ser igual a %{length} pixel"
|
17
17
|
dimension_height_equal_to: "la altura debe ser igual a %{length} pixel"
|
18
18
|
aspect_ratio_not_square: "debe ser una imagen cuadrada"
|
19
|
-
aspect_ratio_not_portrait: "debe ser una imagen
|
20
|
-
aspect_ratio_not_landscape: "debe ser una imagen
|
19
|
+
aspect_ratio_not_portrait: "debe ser una imagen vertical"
|
20
|
+
aspect_ratio_not_landscape: "debe ser una imagen apaisada"
|
21
21
|
aspect_ratio_is_not: "debe tener una relación de aspecto de %{aspect_ratio}"
|
22
22
|
aspect_ratio_unknown: "tiene una relación de aspecto desconocida"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
it:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "ha un tipo di contenuto non valido"
|
5
|
+
file_size_out_of_range: "la dimensione del file %{file_size} non è compresa nell’intervallo consentito"
|
6
|
+
limit_out_of_range: "il valore è al di fuori dell’intervallo consentito"
|
7
|
+
image_metadata_missing: "non è un'immagine valida"
|
8
|
+
dimension_min_inclusion: "deve essere maggiore o uguale a %{width} x %{height} pixel"
|
9
|
+
dimension_max_inclusion: "deve essere minore o uguale a %{width} x %{height} pixel"
|
10
|
+
dimension_width_inclusion: "la larghezza deve essere compresa tra %{min} e %{max} pixel"
|
11
|
+
dimension_height_inclusion: "l’altezza deve essere compresa tra %{min} e %{max} pixel"
|
12
|
+
dimension_width_greater_than_or_equal_to: "la larghezza deve essere maggiore o uguale a %{length} pixel"
|
13
|
+
dimension_height_greater_than_or_equal_to: "l’altezza deve essere maggiore o uguale a %{length} pixel"
|
14
|
+
dimension_width_less_than_or_equal_to: "la larghezza deve essere minore o uguale a %{length} pixel"
|
15
|
+
dimension_height_less_than_or_equal_to: "l’altezza deve essere minore o uguale a %{length} pixel"
|
16
|
+
dimension_width_equal_to: "la larghezza deve essere pari a %{length} pixel"
|
17
|
+
dimension_height_equal_to: "l’altezza deve essere pari a %{length} pixel"
|
18
|
+
aspect_ratio_not_square: "deve essere un’immagine quadrata"
|
19
|
+
aspect_ratio_not_portrait: "l’orientamento dell’immagine deve essere verticale"
|
20
|
+
aspect_ratio_not_landscape: "l’orientamento dell’immagine deve essere orizzontale"
|
21
|
+
aspect_ratio_is_not: "deve avere un rapporto altezza / larghezza di %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "ha un rapporto altezza / larghezza sconosciuto"
|
data/config/locales/nl.yml
CHANGED
File without changes
|
@@ -0,0 +1,22 @@
|
|
1
|
+
pl:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "jest nieprawidłowego typu"
|
5
|
+
file_size_out_of_range: "rozmiar %{file_size} nie zawiera się w dopuszczalnym zakresie"
|
6
|
+
limit_out_of_range: "ilość przekracza dopuszczalny zakres"
|
7
|
+
image_metadata_missing: "nie jest prawidłowym obrazem"
|
8
|
+
dimension_min_inclusion: "musi być równe lub większe od %{width} x %{height} pixeli"
|
9
|
+
dimension_max_inclusion: "musi być równe lub mniejsze od %{width} x %{height} pixeli"
|
10
|
+
dimension_width_inclusion: "szerokość musi wynosić od %{min} do %{max} pixeli"
|
11
|
+
dimension_height_inclusion: "wysokość musi wynosić od %{min} do %{max} pixeli"
|
12
|
+
dimension_width_greater_than_or_equal_to: "szerokość musi mieć co najmniej %{length} pixeli"
|
13
|
+
dimension_height_greater_than_or_equal_to: "wysokość musi mieć co najmniej %{length} pixeli"
|
14
|
+
dimension_width_less_than_or_equal_to: "szerokość musi mieć co najwyżej %{length} pixeli"
|
15
|
+
dimension_height_less_than_or_equal_to: "wysokość musi mieć co najwyżej %{length} pixeli"
|
16
|
+
dimension_width_equal_to: "szerokość musi wynosić %{length} pixeli"
|
17
|
+
dimension_height_equal_to: "wysokość musi wynosić %{length} pixeli"
|
18
|
+
aspect_ratio_not_square: "musi mieć proporcje kwadratu"
|
19
|
+
aspect_ratio_not_portrait: "musi mieć proporcje portretu"
|
20
|
+
aspect_ratio_not_landscape: "musi mieć proporcje pejzażu"
|
21
|
+
aspect_ratio_is_not: "musi mieć proporcje %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "ma nieokreślone proporcje"
|
data/config/locales/ru.yml
CHANGED
File without changes
|
data/config/locales/uk.yml
CHANGED
File without changes
|
@@ -0,0 +1,22 @@
|
|
1
|
+
vi:
|
2
|
+
errors:
|
3
|
+
messages:
|
4
|
+
content_type_invalid: "tệp không hợp lệ"
|
5
|
+
file_size_out_of_range: "kích thước %{file_size} vượt giới hạn"
|
6
|
+
limit_out_of_range: "tổng số tệp vượt giới hạn"
|
7
|
+
image_metadata_missing: "không phải là ảnh"
|
8
|
+
dimension_min_inclusion: "phải lớn hơn hoặc bằng %{width} x %{height} pixel"
|
9
|
+
dimension_max_inclusion: "phải nhỏ hơn hoặc bằng %{width} x %{height} pixel"
|
10
|
+
dimension_width_inclusion: "chiều rộng không nằm trong %{min} và %{max} pixel"
|
11
|
+
dimension_height_inclusion: "chiều cao không nằm trong %{min} và %{max} pixel"
|
12
|
+
dimension_width_greater_than_or_equal_to: "chiều rộng phải lớn hơn hoặc bằng %{length} pixel"
|
13
|
+
dimension_height_greater_than_or_equal_to: "chiều cao phải lớn hơn hoặc bằng %{length} pixel"
|
14
|
+
dimension_width_less_than_or_equal_to: "chiều rộng phải nhỏ hơn hoặc bằng %{length} pixel"
|
15
|
+
dimension_height_less_than_or_equal_to: "chiều cao phải nhỏ hơn hoặc bằng %{length} pixel"
|
16
|
+
dimension_width_equal_to: "chiều rộng phải bằng %{length} pixel"
|
17
|
+
dimension_height_equal_to: "chiều cao phải bằng %{length} pixel"
|
18
|
+
aspect_ratio_not_square: "phải là ảnh hình vuông"
|
19
|
+
aspect_ratio_not_portrait: "phải là ảnh đứng"
|
20
|
+
aspect_ratio_not_landscape: "phải là ảnh ngang"
|
21
|
+
aspect_ratio_is_not: "phải có tỉ lệ ảnh %{aspect_ratio}"
|
22
|
+
aspect_ratio_unknown: "tỉ lệ ảnh không xác định"
|
@@ -18,7 +18,7 @@ module ActiveStorageValidations
|
|
18
18
|
raise ArgumentError, 'You must pass "aspect_ratio: :OPTION" option to the validator'
|
19
19
|
end
|
20
20
|
|
21
|
-
if Rails
|
21
|
+
if Rails.gem_version >= Gem::Version.new('6.0.0')
|
22
22
|
def validate_each(record, attribute, _value)
|
23
23
|
return true unless record.send(attribute).attached?
|
24
24
|
|
@@ -5,7 +5,10 @@ module ActiveStorageValidations
|
|
5
5
|
def validate_each(record, attribute, _value)
|
6
6
|
return if record.send(attribute).attached?
|
7
7
|
|
8
|
-
|
8
|
+
errors_options = {}
|
9
|
+
errors_options[:message] = options[:message] if options[:message].present?
|
10
|
+
|
11
|
+
record.errors.add(attribute, :blank, **errors_options)
|
9
12
|
end
|
10
13
|
end
|
11
14
|
end
|
@@ -20,8 +20,14 @@ module ActiveStorageValidations
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def types
|
23
|
-
|
24
|
-
|
23
|
+
return @types if defined? @types
|
24
|
+
|
25
|
+
@types = (Array.wrap(options[:with]) + Array.wrap(options[:in])).compact.map do |type|
|
26
|
+
if type.is_a?(Regexp)
|
27
|
+
type
|
28
|
+
else
|
29
|
+
Marcel::MimeType.for(declared_type: type.to_s, extension: type.to_s)
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
27
33
|
|
@@ -36,10 +42,9 @@ module ActiveStorageValidations
|
|
36
42
|
end
|
37
43
|
|
38
44
|
def is_valid?(file)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
content_type(file).in?(types)
|
45
|
+
file_type = content_type(file)
|
46
|
+
types.any? do |type|
|
47
|
+
type == file_type || (type.is_a?(Regexp) && type.match?(file_type.to_s))
|
43
48
|
end
|
44
49
|
end
|
45
50
|
end
|
File without changes
|
@@ -10,6 +10,7 @@ module ActiveStorageValidations
|
|
10
10
|
def initialize(attribute_name)
|
11
11
|
@attribute_name = attribute_name
|
12
12
|
@width_min = @width_max = @height_min = @height_max = nil
|
13
|
+
@custom_message = nil
|
13
14
|
end
|
14
15
|
|
15
16
|
def description
|
@@ -26,6 +27,11 @@ module ActiveStorageValidations
|
|
26
27
|
self
|
27
28
|
end
|
28
29
|
|
30
|
+
def with_message(message)
|
31
|
+
@custom_message = message
|
32
|
+
self
|
33
|
+
end
|
34
|
+
|
29
35
|
def width(width)
|
30
36
|
@width_min = @width_max = width
|
31
37
|
self
|
@@ -133,7 +139,8 @@ module ActiveStorageValidations
|
|
133
139
|
attachment = @subject.public_send(@attribute_name)
|
134
140
|
Matchers.mock_metadata(attachment, width, height) do
|
135
141
|
@subject.validate
|
136
|
-
@
|
142
|
+
exclude_error_message = @custom_message || "dimension_#{check}"
|
143
|
+
@subject.errors.details[@attribute_name].all? { |error| error[:error].to_s.exclude?(exclude_error_message) }
|
137
144
|
end
|
138
145
|
end
|
139
146
|
|
File without changes
|
@@ -22,7 +22,7 @@ module ActiveStorageValidations
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.mock_metadata(attachment, width, height)
|
25
|
-
if Rails
|
25
|
+
if Rails.gem_version >= Gem::Version.new('6.0.0')
|
26
26
|
# Mock the Metadata class for rails 6
|
27
27
|
mock = OpenStruct.new(metadata: { width: width, height: height })
|
28
28
|
stub_method(ActiveStorageValidations::Metadata, :new, mock) do
|
@@ -21,17 +21,16 @@ module ActiveStorageValidations
|
|
21
21
|
def read_image
|
22
22
|
is_string = file.is_a?(String)
|
23
23
|
if is_string || file.is_a?(ActiveStorage::Blob)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
blob =
|
25
|
+
if is_string
|
26
|
+
if Rails.gem_version < Gem::Version.new('6.1.0')
|
27
|
+
ActiveStorage::Blob.find_signed(file)
|
28
|
+
else
|
29
|
+
ActiveStorage::Blob.find_signed!(file)
|
30
|
+
end
|
31
|
+
else
|
32
|
+
file
|
31
33
|
end
|
32
|
-
else
|
33
|
-
blob = file
|
34
|
-
end
|
35
34
|
|
36
35
|
tempfile = Tempfile.new(["ActiveStorage-#{blob.id}-", blob.filename.extension_with_delimiter])
|
37
36
|
tempfile.binmode
|
@@ -25,6 +25,9 @@ module ActiveStorageValidations
|
|
25
25
|
next if content_size_valid?(file.blob.byte_size)
|
26
26
|
|
27
27
|
errors_options[:file_size] = number_to_human_size(file.blob.byte_size)
|
28
|
+
errors_options[:min_size] = number_to_human_size(min_size)
|
29
|
+
errors_options[:max_size] = number_to_human_size(max_size)
|
30
|
+
|
28
31
|
record.errors.add(attribute, :file_size_out_of_range, **errors_options)
|
29
32
|
break
|
30
33
|
end
|
@@ -43,5 +46,13 @@ module ActiveStorageValidations
|
|
43
46
|
file_size >= options[:greater_than_or_equal_to]
|
44
47
|
end
|
45
48
|
end
|
49
|
+
|
50
|
+
def min_size
|
51
|
+
options[:between]&.min || options[:greater_than] || options[:greater_than_or_equal_to]
|
52
|
+
end
|
53
|
+
|
54
|
+
def max_size
|
55
|
+
options[:between]&.max || options[:less_than] || options[:less_than_or_equal_to]
|
56
|
+
end
|
46
57
|
end
|
47
58
|
end
|
File without changes
|
metadata
CHANGED
@@ -1,17 +1,59 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_storage_validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Kasyanchuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activejob
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.2.0
|
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.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activemodel
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 5.2.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 5.2.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activestorage
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 5.2.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 5.2.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activesupport
|
15
57
|
requirement: !ruby/object:Gem::Requirement
|
16
58
|
requirements:
|
17
59
|
- - ">="
|
@@ -108,12 +150,15 @@ files:
|
|
108
150
|
- config/locales/en.yml
|
109
151
|
- config/locales/es.yml
|
110
152
|
- config/locales/fr.yml
|
153
|
+
- config/locales/it.yml
|
111
154
|
- config/locales/ja.yml
|
112
155
|
- config/locales/nl.yml
|
156
|
+
- config/locales/pl.yml
|
113
157
|
- config/locales/pt-BR.yml
|
114
158
|
- config/locales/ru.yml
|
115
159
|
- config/locales/tr.yml
|
116
160
|
- config/locales/uk.yml
|
161
|
+
- config/locales/vi.yml
|
117
162
|
- lib/active_storage_validations.rb
|
118
163
|
- lib/active_storage_validations/aspect_ratio_validator.rb
|
119
164
|
- lib/active_storage_validations/attached_validator.rb
|
@@ -150,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
195
|
- !ruby/object:Gem::Version
|
151
196
|
version: '0'
|
152
197
|
requirements: []
|
153
|
-
rubygems_version: 3.
|
198
|
+
rubygems_version: 3.1.4
|
154
199
|
signing_key:
|
155
200
|
specification_version: 4
|
156
201
|
summary: Validations for Active Storage
|