title: Carrierwave: Duplicating File In a Second Model
body: <p>I have two models, each with their own Carrierwave uploaders:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    mount_uploader :avatar, AvatarUploader
  end
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>class Bookshelf &lt; ActiveRecord::Base
    mount_uploader :image, ImageUploader
  end
  </code></pre>
  
  <p>I want the user's avatar to be the latest bookshelf image he's uploaded. I try to achieve this like so:</p>
  
  <pre><code>class BookcasesController &lt; ApplicationController
    def create
      @bookcase = current_user.bookcases.build(params[:bookcase])
      if @bookcase.save
        current_user.avatar = @bookcase.image
        current_user.avatar.recreate_versions!
      end
    end
  end
  </code></pre>
  
  <p>Unfortunately, this has no effect on the avatar at all. How else might I achieve this?</p>