mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #8884 from Matt-Yorkley/image-format-errors
Patch keyword arguments syntax in Paperclip error handling
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user