Commit 34913f12 by Nick Padgett Committed by Prem Sichanugrist

Standardize strip with resy of application. Without to_s, causes errors like…

Standardize strip with resy of application.  Without to_s, causes errors like "undefined method `strip' for image/bmp:MIME::Type".
parent 001fd99f
...@@ -47,7 +47,7 @@ namespace :paperclip do ...@@ -47,7 +47,7 @@ namespace :paperclip do
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(:original) 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.to_s.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")
if Rails.version >= "3.0.0" if Rails.version >= "3.0.0"
instance.save(:validate => false) instance.save(:validate => false)
......
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