Forum: Ruby on Rails Attachment_fu Validation Error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andi G. (Guest)
on 2008-11-07 13:13
Hi there!

I am trying to get attachment_fu to work. It is so good as done, just
one strange error is still there.

this is my model:

--------------------------------------------------------------------

class Motorbike < ActiveRecord::Base

  has_attachment :content_type => :image,
                 :storage => :file_system,
                 :max_size => 500.kilobytes,
                 :resize_to => '800x600>',
                 :thumbnails => { :thumb => '100x100>' }

  validates_as_attachment

  validates_presence_of :brand

end

--------------------------------------------------------------------

If there is an other validation instead of the attachment_fu the model
pop up this error:

ActiveRecord::RecordInvalid in MotorbikesController#create
Validation failed: Brand can't be blank

If there is only the attachment_fu validation, everything works great.

What could be the reason or is there a good way around?

Greenting Chaos
This topic is locked and can not be replied to.