title: Carrierwave NoMethodError: undefined method `name' for nil:NilClass:
body: <p>There is already a similar question here <a href="https://stackoverflow.com/questions/7464536">Rails + CarrierWave: NoMethodError: undefined method `name&#39; for nil:NilClass</a> but the solution there was to fix a typo.</p>
  
  <p>I am already using Rails and Carrierwave in the same project with no problems. There is a simple AR model:</p>
  
  <pre><code>class Upload &lt; ActiveRecord::Base
    attr_accessible :title, :data_file, :caption
    mount_uploader :upload, DataFileUploader
  
    validates :title, :data_file, :presence =&gt; true
  end
  </code></pre>
  
  <p>In the controller thers is as usual:</p>
  
  <pre><code>def create
    @upload = Upload.new(params[:upload])
  
    if @upload.save
      redirect_to new_admin_upload_path, :notice =&gt; t("site.successfully_created_resource")
    else
      render :action =&gt; 'new'
    end
  end
  </code></pre>
  
  <p>Straight forward. When submitting the form the following error occures:</p>
  
  <pre><code>ActiveRecord::StatementInvalid in Admin::UploadsController#create
  
  NoMethodError: undefined method `name' for nil:NilClass: INSERT INTO "uploads" ("caption",    
  "created_at", "data_file", "title", "updated_at") VALUES (?, ?, ?, ?, ?)
  </code></pre>
  
  <p>I don't see the error and don't understand, where name comes from. When leaving away mount_uploader :upload, DataFileUploader in the AR model, everything works fine.</p>
  
  <p>What is wrong here?</p>
  
  <p>Thanks a lot!</p>