Adds a rake test that removes old unattached uploads (#10253).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8893 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -192,7 +192,7 @@ class Attachment < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.prune(age=1.day)
|
||||
attachments = Attachment.all(:conditions => ["created_on < ? AND (container_type IS NULL OR container_type = ''", Time.now - age])
|
||||
attachments = Attachment.all(:conditions => ["created_on < ? AND (container_type IS NULL OR container_type = '')", Time.now - age])
|
||||
attachments.each(&:destroy)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user