Permalink
Browse files

Saw an issue with a nil content_type sometimes in Safari. Fix by doin…

…g to_s.
  • Loading branch information...
1 parent 93f4f3c commit 7ee9dfcaf82accad4949e781b723dbf0bfc78edc @henrik henrik committed with jyurek Sep 22, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/paperclip/attachment.rb
@@ -77,7 +77,7 @@ def assign uploaded_file
logger.info("[paperclip] Writing attributes for #{name}")
@queued_for_write[:original] = uploaded_file.to_tempfile
instance_write(:file_name, uploaded_file.original_filename.strip.gsub(/[^\w\d\.\-]+/, '_'))
- instance_write(:content_type, uploaded_file.content_type.strip)
+ instance_write(:content_type, uploaded_file.content_type.to_s.strip)
instance_write(:file_size, uploaded_file.size.to_i)
instance_write(:updated_at, Time.now)

0 comments on commit 7ee9dfc

Please sign in to comment.