Attachment_fu & update_attributes... bug?


#1

It seems that attachment_fu is a pretty popular plugin (it’s great), but
I’ve been having a terrible time trying to figure out an issue when
using “update_attributes”. I’m storing files on the file system rather
than in a database.

It seems that when “update_attributes” is called with a new file,
upload_data= tries to copy a file that doesn’t exist, the file name of
the new upload_data.

Anyway here’s the error I get:

No such file or directory -public/db_files/songs/4/Song.mp3

/usr/lib/ruby/1.8/fileutils.rb:1182:in stat' /usr/lib/ruby/1.8/fileutils.rb:1182:inlstat’
/usr/lib/ruby/1.8/fileutils.rb:1160:in stat' /usr/lib/ruby/1.8/fileutils.rb:1242:incopy_file’
/usr/lib/ruby/1.8/fileutils.rb:459:in copy_file' /usr/lib/ruby/1.8/fileutils.rb:383:incp’
/usr/lib/ruby/1.8/fileutils.rb:1377:in fu_each_src_dest' /usr/lib/ruby/1.8/fileutils.rb:1393:infu_each_src_dest0’
/usr/lib/ruby/1.8/fileutils.rb:1375:in fu_each_src_dest' /usr/lib/ruby/1.8/fileutils.rb:382:incp’
vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:154:in
copy_to_temp_file' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/object/misc.rb:23:inreturning’
vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:152:in
copy_to_temp_file' vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:288:incopy_to_temp_file’
vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:265:in
temp_paths' vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:272:intemp_path=’
vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:250:in
uploaded_data=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1672:inattributes=’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1671:in
attributes=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1591:inupdate_attributes’
app/controllers/songs_controller.rb:44:in `update’
-e:4

I found some other people reporting these issues, (
http://beast.caboo.se/forums/2/topics/895 &
http://beast.caboo.se/forums/2/topics/899 ). Does anyone have
experience with this problem or have any good work arounds? Thanks.


#2

On 3/27/07, Mitch M. removed_email_address@domain.invalid wrote:

Anyway here’s the error I get:
/usr/lib/ruby/1.8/fileutils.rb:1393:in fu_each_src_dest0' vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:265:inupdate_attributes’
app/controllers/songs_controller.rb:44:in `update’
-e:4

I found some other people reporting these issues, (
http://beast.caboo.se/forums/2/topics/895 &
http://beast.caboo.se/forums/2/topics/899 ). Does anyone have
experience with this problem or have any good work arounds? Thanks.

If someone can write a failing test for this I can look at it. I
haven’t been seeing the issue in the projects I’ve been using it in.


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com