CarrierWave file exists?

If you ever wondered how to check for file if exist while you were using carrierwave gem with storage on amazon S3 here is how.

Assuming you have User class:

class User < ActiveRecord::Base
  mount_uploader :avatar, AvatarUploader

and uploader class
class AvatarUploader < CarrierWave::Uploader::Base
  storage :fog

then only thing that you have to do is this

user = User.first

thats it. I kind of assumed that it should be simple avatar.exist? but you have to get fog instance of file to be able to access exists? method.