# Error for update model with attachment\_fu without file

**URL:** <https://www.ruby-forum.com/t/error-for-update-model-with-attachment-fu-without-file/190459>\
**Category:** Rails\
**Created:** [June 20, 2010, 10:58pm UTC](https://www.ruby-forum.com/t/error-for-update-model-with-attachment-fu-without-file/190459 "2010-06-20T22:58:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_brownstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Post date:** [June 20, 2010, 10:58pm UTC](https://www.ruby-forum.com/t/error-for-update-model-with-attachment-fu-without-file/190459/1 "2010-06-20T22:58:11Z")

</div>

class AlbumSong \< ActiveRecord::Base

MAX\_SIZE\_IN\_MB = 10

has\_attachment :content\_type =\> ‘audio/mp3’,  
:storage =\> :s3,  
:max\_size =\> MAX\_SIZE\_IN\_MB.megabytes

acts\_as\_indexed :fields =\> [:title, :author],  
:index\_file =\> [Rails.root.to\_s, “tmp”, “index”]

belongs\_to :album

validates\_presence\_of :title  
validates\_uniqueness\_of :title  
end

When update a model without file, it appears the following error. How  
can I solve?

TypeError: can’t convert nil into String  
from  
/home/marcelo/hueb/bandas/vendor/plugins/attachment\_fu/lib/technoweenie/attachment\_fu/backends/s3\_backend.rb:262:in  
`join' from /home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb:262:in`full\_filename’  
from  
/home/marcelo/hueb/bandas/vendor/plugins/attachment\_fu/lib/technoweenie/attachment\_fu.rb:367:in  
`temp_paths' from /home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:361:in`temp\_path’  
from  
/home/marcelo/hueb/bandas/vendor/plugins/attachment\_fu/lib/technoweenie/attachment\_fu.rb:320:in  
`save_attachment?' from /home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:424:in`set\_size\_from\_temp\_path’  
from  
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/callbacks.rb:178:in  
`send' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in`evaluate\_method’  
from  
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/callbacks.rb:166:in  
`call' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:93:in`run’  
from  
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/callbacks.rb:92:in  
`each' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in`send’  
from  
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/callbacks.rb:92:in  
`run' from /home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:492:in`run\_callbacks’  
from  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/callbacks.rb:344:in  
`callback' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:311:in`valid?’  
from  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/validations.rb:1077:in  
`save_without_dirty' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in`save\_without\_transactions’  
from  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/transactions.rb:229:in  
`send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in`with\_transaction\_returning\_status’  
from  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/connection\_adapters/abstract/database\_statements.rb:136:in  
`transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in`transaction’  
from  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/transactions.rb:228:in  
`with_transaction_returning_status' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in`save’  
from  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/transactions.rb:208:in  
`rollback_active_record_state!' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in`save’  
from (irb):4\>\>
