frankel/upyun-paperclip — pull request #1 by wuyuntao (2012-02-27 05:07:38+00:00)
Title: Fix "can't convert Paperclip::Tempfile into String" in paperclip 2.7.0

When storing file on upyun in rails 3.2.1, paperclip 2.7.0, it raises a type error.

{{{ ruby
TypeError: can't convert Paperclip::Tempfile into String
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/upyun-paperclip-0.1.5/lib/paperclip/storage/upyun.rb:44:in `read'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/upyun-paperclip-0.1.5/lib/paperclip/storage/upyun.rb:44:in `flush_writes'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/upyun-paperclip-0.1.5/lib/paperclip/storage/upyun.rb:41:in `each'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/upyun-paperclip-0.1.5/lib/paperclip/storage/upyun.rb:41:in `flush_writes'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/paperclip-2.7.0/lib/paperclip/attachment.rb:214:in `save'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/paperclip-2.7.0/lib/paperclip.rb:472:in `send'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/paperclip-2.7.0/lib/paperclip.rb:472:in `save_attached_files'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/paperclip-2.7.0/lib/paperclip.rb:465:in `each_attachment'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/paperclip-2.7.0/lib/paperclip.rb:464:in `each'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/paperclip-2.7.0/lib/paperclip.rb:464:in `each_attachment'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/paperclip-2.7.0/lib/paperclip.rb:471:in `save_attached_files'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:416:in `_run__893993956__save__4__callbacks'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:405:in `send'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:405:in `__run_callback'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:81:in `send'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/mongoid-2.0.2/lib/mongoid/persistence/insert.rb:28:in `persist'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/mongoid-2.0.2/lib/mongoid/persistence.rb:47:in `insert'
from /Users/user/.rvm/gems/ree-1.8.7-2011.03@rails3/gems/mongoid-2.0.2/lib/mongoid/persistence.rb:148:in `save'
}}}