title: Devise Rollback on Signup
body: <p>Afternoon All, </p>
  
  <p>I'm trying to use carrierwave to upload a picture on sign-up. Could anyone tell me why the params is rolling back or point me in the right direction. I am using devise's standard registrations controller and haven't created my own.</p>
  
  <pre><code>    Started POST "/users" for 127.0.0.1 at 2013-11-20 15:16:15 +0100
      Processing by Devise::RegistrationsController#create as HTML
        Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"bB/oSY5s5ohDqivn63sbbehPxQxzkVlt5WVB7BDYNsI=", 
  "user"=&gt;{"first_name"=&gt;"Shaun", "last_name"=&gt;"Shaun", 
  "profile_name"=&gt;"Shaunj9k", "email"=&gt;"shaun@shaun.com", 
  "password"=&gt;"[FILTERED]", "password_confirmation"=&gt;"[FILTERED]",
   "avatar"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x007f3d94a114d0 
  @tempfile=#&lt;File:/tmp/RackMultipart20131120-18938-onc1k9&gt;, @original_filename="12673_607433832654038_1101803441_n.jpg",
   @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"user[avatar]\"; filename=\"12673_607433832654038_1101803441_n.jpg\"\r\nContent-Type: image/jpeg\r\n"&gt;, 
  "avatar_cache"=&gt;""}, 
  "commit"=&gt;"Sign up"}
         (0.7ms)  BEGIN
        User Exists (71.8ms)  SELECT 1 AS one FROM "users" WHERE "users"."email" = 'shaun@shaun.com' LIMIT 1
         (0.3ms)  ROLLBACK
  </code></pre>
  
  <p>Ok, I've been trying to figure this out all night. I have now created a custom controller and stuck pry inside it. This is the process shown below:</p>
  
  <pre><code> def create
      build_resource(sign_up_params)
  binding.pry
      if resource.save
        yield resource if block_given?
        if resource.active_for_authentication?
          set_flash_message :notice, :signed_up if is_flashing_format?
          sign_up(resource_name, resource)
          respond_with resource, :location =&gt; after_sign_up_path_for(resource)
        else
          set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_flashing_format?
          expire_data_after_sign_in!
          respond_with resource, :location =&gt; after_inactive_sign_up_path_for(resource)
        end
      else
        clean_up_passwords resource
        respond_with resource
      end
  
    end
  </code></pre>
  
  <p>So when I get to this breakpoint and inspect params, this is what is shown, right before it jumps to else:</p>
  
  <pre><code>[2] pry(#&lt;RegistrationsController&gt;)&gt; sign_up_params
  =&gt; {"first_name"=&gt;"Marlene",
   "last_name"=&gt;"Annoying",
   "profile_name"=&gt;"AnnoyingMarlene",
   "email"=&gt;"mannoying@smelly.com",
   "password"=&gt;"admin1234",
   "password_confirmation"=&gt;"admin1234",
   "avatar"=&gt;
    #&lt;ActionDispatch::Http::UploadedFile:0xb2f69d18
     @content_type="image/jpeg",
     @headers=
      "Content-Disposition: form-data; name=\"user[avatar]\"; filename=\"picture.jpeg\"\r\nContent-Type: image/jpeg\r\n",
     @original_filename="picture.jpeg",
     @tempfile=#&lt;File:/tmp/RackMultipart20131121-14703-1fubdpu&gt;&gt;,
   "avatar_cache"=&gt;"1385025876-14703-8014/Link_to_sublime_text"}
  </code></pre>
  
  <p>Here is the store dir in AvatarUploader.rb</p>
  
  <pre><code> def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
  </code></pre>