jnicklas/carrierwave — Issue #524: Cache upload file earlier than before_save
Author: khoan
Created: 2011-11-15 23:58:27+00:00
State: open

This is more of a comment than issue report.

```ruby
# If we have this model
class MyModel < ActiveRecord::Base
mount_uploader :bam, BamUploader
...
before_save :set_bam
...
def set_bam
self.bam = File.open("bam") if need_to_set_bam?
end
end

m = MyModel.new
m.save

m.bam # => nil
```

Looks like CarrierWave is doing its magic on before_save and our callback is executed after CarrierWave's. So if we do our business on after_validation, then all is happy.