Skip to content

Commit

Permalink
Standardize strip with resy of application. Without to_s, causes erro…
Browse files Browse the repository at this point in the history
…rs like "undefined method `strip' for image/bmp:MIME::Type".
  • Loading branch information
Nick Padgett authored and sikachu committed Dec 12, 2011
1 parent 001fd99 commit 34913f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tasks/paperclip.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 34913f1

Please sign in to comment.