Validates_format error


#1

How does validate work? Is the file uploaded before the format is
checked? I tried uploading a pdf and it crashed the WEBrick. Out
putting this over and over:

**** Warning: Fonts with Subtype = /TrueType should be embedded.
But BookmanOldStyle is not embedded.

Surely the file should have been rejected before it is even uploaded?

Model:

class Image < ActiveRecord::Base
belongs_to :user

validates_presence_of :title, :file

validates_format_of :file, :with => %r{(gif|jpg|png)$}i, :message =>
“File must end with .jpg, .gif or .png”

file_column :file, :magick => {
:versions => { “thumb” => “100x100”, “medium” => “640x480>” }
}

end