Re: attachment_fu validation error

Xavier Noria
Fri, 29 Jun 2007 20:37:10 -0000

On Jun 29, 2007, at 8:33 PM, Xavier Noria wrote:

> validates_associated if no logo is uploaded in its edition. I
don''t
> see why valid? ends up calling set_size_from_temp_path, sizes were
> correctly computed and stored on creation:

I''ve seen something: that method is set as a before_validation,
that''s why it gets called. Following the traces the plugin tries to
determine whether the logo needs to be saved in save_attachment?
which in the end results in a call to temp_paths

   def temp_paths
     @temp_paths ||= (new_record? || !File.exist?(full_filename)) ?
[] : [copy_to_temp_file(full_filename)]
   end

full_filename is implemented by the file system and s3 backends, but
it is missing in the database backend which is the one I am using. I
don''t know enough about the plugin at this moment to propose a
suitable fix, but at least I write a custom quick fix and go on with
the project.

-- fxn


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---