From b455ac2a27aefccdf10c9f3a1727e1edb8b41ae1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 16 Feb 2012 21:18:01 +0000 Subject: 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 --- app/models/attachment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/attachment.rb') diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 7fb9ed379..d87a9df4c 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -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 -- cgit v1.2.3