Patch keyword arguments syntax in Paperclip error handling

This commit is contained in:
Matt-Yorkley
2022-02-14 11:53:40 +00:00
parent 6acd8a29f2
commit 0c2a267bea

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)