title: Generate unique filename
body: <p>I need unique filenames for my files.</p>
  
  <pre><code>def filename
      "#{SecureRandom.urlsafe_base64}.gif"
  end
  </code></pre>
  
  <p>This saves a file such as this:</p>
  
  <pre><code>ylGP48WxZXOY2OQ_x9dxAA.gif
  </code></pre>
  
  <p>however its respective field in the database to be saved like this:</p>
  
  <pre><code>jED48PRNz0asZzwYQXzecw.gif
  </code></pre>
  
  <p>I think what's happening is that Carrierwave is calling the <code>file_name</code> function when it's writing the file and when its saving the instance in the database, resulting in urlsafe_base64 being called twice and creating two different strings. It works perfectly when I've hardcoded a name as a test.</p>
  
  <p>So how can stop this? I know it's outrageous to ask, but how can I make Carrierwave use the same randomly generated filename in the database and when writing the file? I seriously think this should be considered a bug. </p>