Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Do not add current model to the class_with_attachment list if it's al…
Browse files Browse the repository at this point in the history
…ready there

Thank you @Bonias for reporting in

Closes #590
  • Loading branch information
sikachu committed Sep 23, 2011
1 parent fd891e0 commit d18d814
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paperclip.rb
Expand Up @@ -289,7 +289,7 @@ def has_attached_file name, options = {}
end

attachment_definitions[name] = {:validations => []}.merge(options)
Paperclip.classes_with_attachments << self
Paperclip.classes_with_attachments << self unless Paperclip.classes_with_attachments.include?(self)

after_save :save_attached_files
before_destroy :prepare_for_destroy
Expand Down

5 comments on commit d18d814

@evgeniy123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether it has helped somebody

@alxgsv
Copy link
Contributor

@alxgsv alxgsv commented on d18d814 Oct 4, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evgeniy123 — no, still leaking :-(

@evgeniy123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@,|,@ f...............k !!!

@alxgsv
Copy link
Contributor

@alxgsv alxgsv commented on d18d814 Oct 4, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evgeniy123 use paperclip 2.3.11 — no leaks for me

@sikachu really, something wrong with 2.4.2 — eating memory as a monster :-(

But only when cache_classes = false

@evgeniy123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx my friend. We are the champions !!!

Please sign in to comment.