Validation problems

9 views
Skip to first unread message

lmcdougall

unread,
Jun 16, 2010, 12:47:45 PM6/16/10
to Paperclip Plugin
Hi all,
I have a very simple model. I am using the following validations:
validates_attachment_size :photo, :less_than => 3.megabytes
validates_attachment_content_type :photo, :content_type => ['image/
jpeg', 'image/png']

notice that I am not validating the presence of the attachment, but I
still get the error of
# Photo file size file size must be between 0 and 5242880 bytes.
# Photo content type is not one of image/jpeg, image/png

Is there a fix for this or should I be looking for something wrong
with my code.

Thanks

Gordon Yeong

unread,
Jun 16, 2010, 5:06:21 PM6/16/10
to papercli...@googlegroups.com
ok, which browser are you using?

Regards,
Gordon Yeong

In matters of style, swim with the current,
In matters of principle, stand like a rock.
 - Thomas Jefferson

Hope is tomorrow's veneer over today's disappointment.
 - Evan Esar

I never argue with idiots anymore. They have brought me down to their levels and beaten me with their experience.
- Gordon Yeong



--
Individuals over processes. Interactions over tools.

Agile Rails training from thoughtbot, the makers of Paperclip, Clearance, Shoulda, & Factory Girl:
http://thoughtbot.com/services/training

The Paperclip group:
http://groups.google.com/group/paperclip-plugin

To post to this group, send email to
papercli...@googlegroups.com

To unsubscribe from this group, send email to
paperclip-plug...@googlegroups.com

Timo Rößner

unread,
Jun 17, 2010, 6:38:15 AM6/17/10
to Paperclip Plugin
@mcdougall

that's my problem as well:

http://groups.google.com/group/paperclip-plugin/browse_thread/thread/ebc2c79445accce6

And I am pretty sure that this is a bad, bad paperclip bug.

On Jun 16, 11:06 pm, Gordon Yeong <anexi...@gmail.com> wrote:
> ok, which browser are you using?
>
> Regards,
> Gordon Yeong
>
> In matters of style, swim with the current,
> In matters of principle, stand like a rock.
>  - Thomas Jefferson
>
> Hope is tomorrow's veneer over today's disappointment.
>  - Evan Esar
>
> I never argue with idiots anymore. They have brought me down to their levels
> and beaten me with their experience.
> - Gordon Yeong
>
> On 17 June 2010 02:47, lmcdougall <luismcdoug...@gmail.com> wrote:
>
> > Hi all,
> > I have a very simple model. I am using the following validations:
> >  validates_attachment_size :photo, :less_than => 3.megabytes
> >  validates_attachment_content_type :photo, :content_type => ['image/
> > jpeg', 'image/png']
>
> > notice that I am not validating the presence of the attachment, but I
> > still get the error of
> > # Photo file size file size must be between 0 and 5242880 bytes.
> > # Photo content type is not one of image/jpeg, image/png
>
> > Is there a fix for this or should I be looking for something wrong
> > with my code.
>
> > Thanks
>
> > --
> > Individuals over processes. Interactions over tools.
>
> > Agile Rails training from thoughtbot, the makers of Paperclip, Clearance,
> > Shoulda, & Factory Girl:
> >http://thoughtbot.com/services/training
>
> > The Paperclip group:
> >http://groups.google.com/group/paperclip-plugin
>
> > To post to this group, send email to
> > papercli...@googlegroups.com
>
> > To unsubscribe from this group, send email to
> > paperclip-plug...@googlegroups.com<paperclip-plugin%2Bunsu...@googlegroups.com>

Jonathan Yurek

unread,
Jun 18, 2010, 12:01:44 AM6/18/10
to papercli...@googlegroups.com
Yeah, it was a bug. Turns out the tests were giving false positives which is why I never saw it before. This should be fixed on master now, though.

--
Jonathan Yurek, Founder and CTO
thoughtbot, inc.
organic brains. digital solutions.

617.482.1300 x114
http://www.thoughtbot.com/

Reply all
Reply to author
Forward
0 new messages