diff --git a/README.md b/README.md index f09a5663..2de97d56 100755 --- a/README.md +++ b/README.md @@ -202,7 +202,6 @@ en: aspect_ratio_not_portrait: "must be a portrait image" aspect_ratio_not_landscape: "must be a landscape image" aspect_ratio_is_not: "must have an aspect ratio of %{aspect_ratio}" - aspect_ratio_unknown: "has an unknown aspect ratio" image_not_processable: "is not a valid image" ``` diff --git a/config/locales/da.yml b/config/locales/da.yml index 2fa8c788..f35c2dd0 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -29,5 +29,4 @@ da: aspect_ratio_not_portrait: "skal være et portrætbillede" aspect_ratio_not_landscape: "skal være et landskabsbillede" aspect_ratio_is_not: "skal have et størrelsesforhold på %{aspect_ratio}" - aspect_ratio_unknown: "har et ukendt størrelsesforhold" image_not_processable: "er ikke et gyldigt billede" diff --git a/config/locales/de.yml b/config/locales/de.yml index 1ced0115..5adc90fa 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -29,5 +29,4 @@ de: aspect_ratio_not_portrait: "muss Hochformat sein" aspect_ratio_not_landscape: "muss Querformat sein" aspect_ratio_is_not: "muss ein Bildseitenverhältnis von %{aspect_ratio} haben" - aspect_ratio_unknown: "hat ein unbekanntes Bildseitenverhältnis" image_not_processable: "ist kein gültiges Bild" diff --git a/config/locales/en.yml b/config/locales/en.yml index 7b485729..d687e481 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -29,5 +29,4 @@ en: aspect_ratio_not_portrait: "must be a portrait image" aspect_ratio_not_landscape: "must be a landscape image" aspect_ratio_is_not: "must have an aspect ratio of %{aspect_ratio}" - aspect_ratio_unknown: "has an unknown aspect ratio" image_not_processable: "is not a valid image" diff --git a/config/locales/es.yml b/config/locales/es.yml index e8d32f9a..ef0a26d7 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -29,5 +29,4 @@ es: aspect_ratio_not_portrait: "debe ser una imagen vertical" aspect_ratio_not_landscape: "debe ser una imagen apaisada" aspect_ratio_is_not: "debe tener una relación de aspecto de %{aspect_ratio}" - aspect_ratio_unknown: "tiene una relación de aspecto desconocida" image_not_processable: "no es una imagen válida" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index bf40f2bd..beaa7750 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -29,5 +29,4 @@ fr: aspect_ratio_not_portrait: "doit être une image en format portrait" aspect_ratio_not_landscape: "doit être une image en format paysage" aspect_ratio_is_not: "doit avoir un rapport hauteur / largeur de %{aspect_ratio}" - aspect_ratio_unknown: "a un rapport d'aspect inconnu" image_not_processable: "n'est pas une image valide" diff --git a/config/locales/it.yml b/config/locales/it.yml index ac74ff7b..7b73c319 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -29,5 +29,4 @@ it: aspect_ratio_not_portrait: "l’orientamento dell’immagine deve essere verticale" aspect_ratio_not_landscape: "l’orientamento dell’immagine deve essere orizzontale" aspect_ratio_is_not: "deve avere un rapporto altezza / larghezza di %{aspect_ratio}" - aspect_ratio_unknown: "ha un rapporto altezza / larghezza sconosciuto" image_not_processable: "non è un'immagine valida" diff --git a/config/locales/ja.yml b/config/locales/ja.yml index d72239d2..69fdf66c 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -29,5 +29,4 @@ ja: aspect_ratio_not_portrait: "は縦長にしてください" aspect_ratio_not_landscape: "は横長にしてください" aspect_ratio_is_not: "のアスペクト比は %{aspect_ratio} にしてください" - aspect_ratio_unknown: "のアスペクト比を取得できませんでした" image_not_processable: "は不正な画像です" diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 1ef1eddd..df37b189 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -29,5 +29,4 @@ nl: aspect_ratio_not_portrait: "moet een staande afbeelding zijn" aspect_ratio_not_landscape: "moet een liggende afbeelding zijn" aspect_ratio_is_not: "moet een beeldverhouding hebben van %{aspect_ratio}" - aspect_ratio_unknown: "heeft een onbekende beeldverhouding" image_not_processable: "is geen geldige afbeelding" diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 4536d23f..e468b39f 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -29,5 +29,4 @@ pl: aspect_ratio_not_portrait: "musi mieć proporcje portretu" aspect_ratio_not_landscape: "musi mieć proporcje pejzażu" aspect_ratio_is_not: "musi mieć proporcje %{aspect_ratio}" - aspect_ratio_unknown: "ma nieokreślone proporcje" image_not_processable: "nie jest prawidłowym obrazem" diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index e4fc6f48..30ad994a 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -29,5 +29,4 @@ pt-BR: aspect_ratio_not_portrait: "não está no formato retrato" aspect_ratio_not_landscape: "não está no formato paisagem" aspect_ratio_is_not: "não contém uma proporção de %{aspect_ratio}" - aspect_ratio_unknown: "não tem uma proporção definida" image_not_processable: "não é uma imagem válida" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 2026d80d..b479900f 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -29,5 +29,4 @@ ru: aspect_ratio_not_portrait: "должно быть портретное изображение" aspect_ratio_not_landscape: "должно быть пейзажное изображение" aspect_ratio_is_not: "должен иметь соотношение сторон %{aspect_ratio}" - aspect_ratio_unknown: "имеет неизвестное соотношение сторон" image_not_processable: "не является допустимым изображением" diff --git a/config/locales/sv.yml b/config/locales/sv.yml index c622ae2d..87f4a0fd 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -29,5 +29,4 @@ sv: aspect_ratio_not_portrait: "måste vara en porträttorienterad bild" aspect_ratio_not_landscape: "måste vara en landskapsorienterad bild" aspect_ratio_is_not: "måste ha en följande aspect ratio %{aspect_ratio}" - aspect_ratio_unknown: "har en okänd aspect ratio" image_not_processable: "är inte en giltig bild" diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 8e30788e..ae4753e3 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -29,5 +29,4 @@ tr: aspect_ratio_not_portrait: "dikey bir imaj olmalı" aspect_ratio_not_landscape: "yatay bir imaj olmalı" aspect_ratio_is_not: "%{aspect_ratio} en boy oranına sahip olmalı" - aspect_ratio_unknown: "bilinmeyen en boy oranı" image_not_processable: "geçerli bir imaj değil" diff --git a/config/locales/uk.yml b/config/locales/uk.yml index d5fc80fc..351ad22d 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -29,5 +29,4 @@ uk: aspect_ratio_not_portrait: "мусить бути портретне зображення" aspect_ratio_not_landscape: "мусить бути пейзажне зображення" aspect_ratio_is_not: "мусить мати співвідношення сторін %{aspect_ratio}" - aspect_ratio_unknown: "має невідоме співвідношення сторін" image_not_processable: "не є допустимим зображенням" diff --git a/config/locales/vi.yml b/config/locales/vi.yml index aee1b573..cf2bdc5e 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -29,5 +29,4 @@ vi: aspect_ratio_not_portrait: "phải là ảnh đứng" aspect_ratio_not_landscape: "phải là ảnh ngang" aspect_ratio_is_not: "phải có tỉ lệ ảnh %{aspect_ratio}" - aspect_ratio_unknown: "tỉ lệ ảnh không xác định" image_not_processable: "không phải là ảnh" diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 7cdd82a0..7adf9533 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -29,5 +29,4 @@ zh-CN: aspect_ratio_not_portrait: "必须是竖屏图片" aspect_ratio_not_landscape: "必须是横屏图片" aspect_ratio_is_not: "纵横比必须是 %{aspect_ratio}" - aspect_ratio_unknown: "未知的纵横比" image_not_processable: "不是有效的图像" diff --git a/lib/active_storage_validations/aspect_ratio_validator.rb b/lib/active_storage_validations/aspect_ratio_validator.rb index bbeddd48..b6b82a53 100644 --- a/lib/active_storage_validations/aspect_ratio_validator.rb +++ b/lib/active_storage_validations/aspect_ratio_validator.rb @@ -22,7 +22,6 @@ class AspectRatioValidator < ActiveModel::EachValidator # :nodoc aspect_ratio_not_portrait aspect_ratio_not_landscape aspect_ratio_is_not - aspect_ratio_unknown ].freeze PRECISION = 3.freeze @@ -75,10 +74,6 @@ def is_valid?(record, attribute, attachable, metadata) errors_options[:aspect_ratio] = "#{x}:#{y}" add_error(record, attribute, :aspect_ratio_is_not, **errors_options) - else - errors_options[:aspect_ratio] = flat_options[:with] - add_error(record, attribute, :aspect_ratio_unknown, **errors_options) - return false end end