thoughtbot/paperclip — Issue #671: Error when try creating a new attachment
Author: yega
Created: 2011-12-12 07:15:46+00:00
State: open

When i try creating new attachment, i get:

A NoMethodError occurred in assets#create:

undefined method `size' for nil:NilClass
paperclip (2.4.5) lib/paperclip/attachment.rb:121:in `assign'

Аfter migrating from 2.3.16 and got this error, even though the file is saved. But this mistake breke futher logic.
```ruby
has_attached_file :asset, :styles => {:preview => {:geometry => "112x84#",
:quality => 10,
:format => "jpg",
:name => "preview"},
:main => {
:geometry => "496x370#",
:quality => 50,
:format => "jpg",
:name => "main"
},
:half => {
:geometry => "240x180#",
:quality => 50,
:format => 'jpg',
:name => 'half'
},
:album => {
:geometry => "800x",
:quality => 50,
:format => 'jpg',
:name => 'album'
}
}
```