Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

missing paperclip validation in store model #103

Closed
leveragei opened this issue Sep 4, 2014 · 5 comments
Closed

missing paperclip validation in store model #103

leveragei opened this issue Sep 4, 2014 · 5 comments

Comments

@leveragei
Copy link

please note than when using Rails4 and PaperClip 2.4, attempting to upload a store logo image produces the following error:

Paperclip::Errors::MissingRequiredValidatorError

@leveragei
Copy link
Author

you need to add the following in your store_decorator:
validates_attachment_file_name :logo, :matches => [/png\Z/, /jpe?g\Z/]

@JDutil
Copy link
Member

JDutil commented Sep 4, 2014

would you mind submitting a PR?

@schmijos
Copy link

schmijos commented Oct 6, 2014

Wouldn't it be better to actually check the content type:

validates_attachment_content_type :logo, :content_type => /\Aimage/

That would need some more database fields then.

@JDutil
Copy link
Member

JDutil commented Oct 7, 2014

Yes that would make more sense if you want to submit a PR.

@hxegon
Copy link

hxegon commented Sep 15, 2016

Might have had a regression. I'm on a fresh 3-1 install and this is popping up exactly as described. I'll update once I've looked into it more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants