Forum: Ruby on Rails File_column validation ignored

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Eb9ebc40bff573d56fce8803569c6f47?d=identicon&s=25 Robert (Guest)
on 2007-03-07 18:12
(Received via mailing list)
I'm using the file_column plugin to upload a small avatar, but when I
do this:

@user.update_attribute("picture", params[:user][:picture])

... it completely ignores the validations I've set for the element

validates_file_format_of :picture, :in => ["gif", "jpg", "png"]
validates_filesize_of :picture, :in => 1.kilobytes..100.kilobytes

I'm able to upload PDF's, textfiles, etc., which is ofcourse rather
crappy. I've added this to my model, in case you're wondering:

file_column :picture, :base_url => "images/people", :filename =>
"picture", :store_dir => "public/images/people/",
   :magick => {
    :size => '48x48!',
    :crop => '1:1',
    :versions => {
      :thumb => {:crop => "1:1", :size => "16x16!", :name => "thumb"}

Has anybody else experienced this problem?
Eb9ebc40bff573d56fce8803569c6f47?d=identicon&s=25 Robert (Guest)
on 2007-03-16 17:17
(Received via mailing list)
Bump :)

11a08b97f4904999b2398a0c265b38e4?d=identicon&s=25 Frioffol Friofool (friofool)
on 2007-03-16 18:09
Robert wrote:
> Bump :)
> Anybody?

i already had the same problem and i didn't find a solution.

anybody ?
Eb9ebc40bff573d56fce8803569c6f47?d=identicon&s=25 Robert (Guest)
on 2007-03-19 10:58
(Received via mailing list)
I've tried including validations.rb in my setup, but that also does
not work.

On Mar 16, 6:09 pm, Frioffol Friofool <rails-mailing-l...@andreas-
This topic is locked and can not be replied to.