Carrierwave returns path of tmp file instead of actual in a callback
<p>In an application I wanted to send public file URL to a service in an <code>after_create</code> callback. So, the code (simplified) looked like this:</p>

<pre><code>class UserProfile &lt; ApplicationRecord
  mount_uploader :video, VideoUploader
  after_create :send_url_to_service

  private

  # Just logs the URL
  def send_url_to_service
    Rails.logger.info video.url
  end
end
</code></pre>

<p>To my frustration, after the upload, the <code>send_url_to_service</code> callback always logged the cached file path - something like <code>'uploads/tmp/1473900000-123-0001-0123/file.mp4'</code> instead of <code>'uploads/user_profiles/video/1/file.mp4'</code>. I tried to write a method to form the URL from the actual file path, but it did not work because the file wasn't there yet.</p>

<p>So, the question is, how do you obtain a final file URL in a situation like this?</p>

<p><em>P. S. Please note, this is a self-answered question, I just wanted to share my experience.</em></p>