I just used attachment_fu for the first time, and it works quite well. I have a user-model, and each of them has_one :image (and the images belongs_to :user). I have a question on this though: how can i remove images? Whenever i set a new image for a user (a user who already has an image), then the table with images gets updated correctly, with the user_id column of the old image set to null, and the new image then has the correct user_id. What i want is ofcourse to remove the old image (which has no references to any user anymore) from the database and the filesystem, and the same for the thumbnail that was created with it. Does attachment_fu have methods for this? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter wrote:> What i want is ofcourse to remove the old image (which has no > references to any user anymore) from the database and the filesystem, > and the same for the thumbnail that was created with it. > > Does attachment_fu have methods for this?Did you try: user.image.destroy or user.image.delete (bypass callbacks?) hth ilan -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That works quite good. I have the feeling i should''ve known or at least tried that :) Thank you! On Feb 23, 8:29 pm, Ilan Berci <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Peter wrote: > > What i want is ofcourse to remove the old image (which has no > > references to any user anymore) from the database and the filesystem, > > and the same for the thumbnail that was created with it. > > > Does attachment_fu have methods for this? > > Did you try: user.image.destroy or user.image.delete (bypass > callbacks?) > > hth > > ilan > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter wrote:> That works quite good. I have the feeling i should''ve known or at > least tried that :) > > Thank you! > > On Feb 23, 8:29 pm, Ilan Berci <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>No worries at all, I can''t count the times I got an answer and then proceeded to smack my head on the desk! ilan -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Seemingly Similar Threads
- attachment_fu seems to be searching the wrong location for my images
- Dynamically setting the image directory used by attachment_fu
- Attachment_fu - watermark tmp file before saved to S3
- Making attachment_fu polymorphic
- saving the user id for thumbnails using attachment_fu