Permalink
Browse files

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

…rs like "undefined method `strip' for image/bmp:MIME::Type".
  • Loading branch information...
1 parent 001fd99 commit 34913f12894b53031456c5cbbcb7117a8d912bbc Nick Padgett committed with sikachu Dec 8, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/tasks/paperclip.rake
View
@@ -47,7 +47,7 @@ namespace :paperclip do
Paperclip.each_instance_with_attachment(klass, name) do |instance|
if file = instance.send(name).to_file(:original)
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")
if Rails.version >= "3.0.0"
instance.save(:validate => false)

0 comments on commit 34913f1

Please sign in to comment.