public
Description: Paperclip File Management Plugin
Homepage: http://www.thoughtbot.com/projects/paperclip
Clone URL: git://github.com/thoughtbot/paperclip.git
Fixed the rake task.
jyurek (author)
Tue May 13 10:04:55 -0700 2008
commit  7832694f2c6dbe50567df805b4f6b9f71868a08c
tree    551d65b56ef8687942d21f7d7e53f5c6582098a8
parent  d177c8f838458348a9f4d1fe41918c5bd99a989c
...
6
7
8
9
10
 
 
11
12
13
...
19
20
21
 
22
23
24
 
25
26
27
...
6
7
8
 
 
9
10
11
12
13
...
19
20
21
22
23
24
 
25
26
27
28
0
@@ -6,8 +6,8 @@ end
0
 
0
 def obtain_attachments
0
   name = ENV['ATTACHMENT'] || ENV['attachment']
0
- raise "Class #{@klass.name} has no attachments specified" unless @klass.respond_to?(:attachment_names)
0
- if !name.blank? && @klass.attachment_names.include?(name)
0
+ raise "Class #{@klass.name} has no attachments specified" unless @klass.respond_to?(:attachment_definitions)
0
+ if !name.blank? && @klass.attachment_definitions.keys.include?(name)
0
     [ name ]
0
   else
0
     @klass.attachment_definitions.keys
0
@@ -19,9 +19,10 @@ namespace :paperclip do
0
   task :refresh => :environment do
0
     klass = obtain_class
0
     names = obtain_attachments
0
+ instances = klass.find(:all)
0
     
0
     puts "Regenerating thumbnails for #{instances.length} instances of #{klass.name}:"
0
- klass.find(:all).each do |instance|
0
+ instances.each do |instance|
0
       names.each do |name|
0
         result = if instance.send("#{ name }?")
0
           instance.send(name).send("post_process")

Comments

    No one has commented yet.