Hi everyone,
I''m just upgrading an app from acts_as_attachment to attachment_fu and
have
run into an issue using the with_image method on existing attachment
records.
It worked fine in acts_as_attachment but in attachment_fu it simply does not
work at all, ruby actually hangs. It''s not too surprising really, since
internally a blank string has been passed to Magick::Image.read instead of
an actual file to load. The with_image method assumes that a temporary file
is present, which it would be when the uploaded data has just been assigned,
but not when working with a previously saved record.
A little patch to the plugin can fix it but it doesn''t seem like the
best
solution:
def with_image(&block)
# Write out the temporary data if it is not present
if temp_data.nil?
self.temp_data = current_data
end
self.class.with_image(temp_path, &block)
end
Anybody else had this problem?
-Jonathan.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---