title: why when i'm upload image using carrierwave in rails 4 database is rollback?
body: <p>i try to save image file using carrierwave in rails 4, but when submit button is click database is rollback??? why ?</p>
  
  <p>if i dont select image to upload and just send string only, all work properly but if i send image file i get error like this :</p>
  
  <pre><code>TypeError: can't cast ActionDispatch::Http::UploadedFile to string: INSERT INTO "items" ("created_at", "description", "image", "name", "store_id", "sub_items", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)
     (0.2ms)  rollback transaction
  *** ActiveRecord::StatementInvalid Exception: TypeError: can't cast ActionDispatch::Http::UploadedFile to string: INSERT INTO "items" ("created_at", "description", "image", "name", "store_id", "sub_items", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)
  </code></pre>
  
  <p>my view :</p>
  
  <pre><code>&lt;%= form_for @items, :url =&gt; dashboard_create_items_path(@store.id), :html =&gt; {:multipart =&gt; true} do |f| %&gt;
    &lt;%= f.label :name, 'Name' %&gt;
    &lt;%= f.text_field :name %&gt;&lt;br /&gt;
    &lt;%= f.label :title, 'Title' %&gt;
    &lt;%= f.text_field :title %&gt;&lt;br /&gt;
    &lt;%= f.label :image, 'Image' %&gt;
     &lt;%= f.file_field :image %&gt;&lt;br /&gt;
    &lt;%= f.label :description, 'Description' %&gt;
    &lt;%= f.text_field :description %&gt;&lt;br /&gt;
    &lt;%= f.label :sub_items %&gt;&lt;br&gt;
    &lt;%= f.select :sub_items, options_for_select([["true", true], ["false", false]]), :selected =&gt; 'true' %&gt;&lt;br /&gt;
    &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>my controller :</p>
  
  <pre><code>def create_items    
      store = Store.find(params[:id])
      @items = store.items.create(item_params)
  
      if @items
        redirect_to dashboard_show_items_url(@items.id, store.id)
      else
        redirect_to dashboard_new_items_url
      end
    end
  
  private
  
      def item_params
        params.require(:item).permit(:name, :title, :image, :description, :sub_items, :store_id)
      end
  </code></pre>
  
  <p>please tell me when i'm wrong? thanks before</p>