Merge pull request #8884 from Matt-Yorkley/image-format-errors

Patch keyword arguments syntax in Paperclip error handling
This commit is contained in:
Filipe
2022-04-13 19:38:07 +01:00
committed by GitHub

View File

@@ -36,4 +36,11 @@ module UpdatedUrlGenerator
end
end
module PaperclipImageErrors
def mark_invalid(record, attribute, types)
record.errors.add attribute, :invalid, **options.merge(:types => types.join(', '))
end
end
Paperclip::UrlGenerator.prepend(UpdatedUrlGenerator)
Paperclip::Validators::AttachmentPresenceValidator.prepend(PaperclipImageErrors)