Drogomir
2008-Sep-15 20:24 UTC
[attachment_fu] Allways triggering after_attachment_saved callback
Hi, I use attachment_fu in one of my apps and recently I''ve realized that udpates are taking too much time. After some debugging I''ve found that attachment_fu is calling after_attachment_saved callback no mather if attachemnt has changed or not. For example this code: after_attachment_saved do |photo| logger.info "after_attachment_saved" end # in console - always logging "after_attachment_saved" to logs # no mather if attachment changed or not Photo.find(1).save Could anyone check if after_attachment_saved triggers only when attachment is actually saved? I don''t know if it''s my mistake or bug in attachment_fu. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''ve created new application (rails 2.1.1) and implemented attachment_fu like here: http://clarkware.com/cgi/blosxom/2007/02/24 The same issue. I''ve figured out that attachment_fu is allways (for saved files) creating temp files in temp_paths method and since saved_attachment? method relies on temp files it allways returns true... On Sep 15, 10:24 pm, Drogomir <dro...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I use attachment_fu in one of my apps and recently I''ve realized that > udpates are taking too much time. After some debugging I''ve found that > attachment_fu is calling after_attachment_saved callback no mather if > attachemnt has changed or not. > > For example this code: > after_attachment_saved do |photo| > logger.info "after_attachment_saved" > end > > # in console - always logging "after_attachment_saved" to logs > # no mather if attachment changed or not > Photo.find(1).save > > Could anyone check if after_attachment_saved triggers only when > attachment is actually saved? I don''t know if it''s my mistake or bug > in attachment_fu.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---