Commit d18d814d by Prem Sichanugrist

Do not add current model to the class_with_attachment list if it's already there

Thank you @Bonias for reporting in

Closes #590
parent fd891e04
...@@ -289,7 +289,7 @@ module Paperclip ...@@ -289,7 +289,7 @@ module Paperclip
end end
attachment_definitions[name] = {:validations => []}.merge(options) 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 after_save :save_attached_files
before_destroy :prepare_for_destroy before_destroy :prepare_for_destroy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment