Commit 791b70d7 by S. Brent Faulkner Committed by Prem Sichanugrist

use :original style when refreshing metadata

Closes #213
parent 9050ecd5
...@@ -41,7 +41,7 @@ namespace :paperclip do ...@@ -41,7 +41,7 @@ namespace :paperclip do
names = obtain_attachments(klass) names = obtain_attachments(klass)
names.each do |name| names.each do |name|
Paperclip.each_instance_with_attachment(klass, name) do |instance| Paperclip.each_instance_with_attachment(klass, name) do |instance|
if file = instance.send(name).to_file if file = instance.send(name).to_file(:original)
instance.send("#{name}_file_name=", instance.send("#{name}_file_name").strip) instance.send("#{name}_file_name=", instance.send("#{name}_file_name").strip)
instance.send("#{name}_content_type=", file.content_type.strip) instance.send("#{name}_content_type=", file.content_type.strip)
instance.send("#{name}_file_size=", file.size) if instance.respond_to?("#{name}_file_size") instance.send("#{name}_file_size=", file.size) if instance.respond_to?("#{name}_file_size")
......
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