mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
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