Class: Xhive::ImageUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Includes:
CarrierWave::MiniMagick, Sprockets::Helpers::IsolatedHelper, Sprockets::Helpers::RailsHelper
Defined in:
app/uploaders/xhive/image_uploader.rb

Instance Method Summary collapse

Instance Method Details

#cache_dirObject

For heroku read-only filesystem



31
32
33
# File 'app/uploaders/xhive/image_uploader.rb', line 31

def cache_dir
  "#{Rails.root}/tmp/uploads"
end

#default_urlObject



14
15
16
# File 'app/uploaders/xhive/image_uploader.rb', line 14

def default_url
  asset_path "fallback/" + [version_name, "default.png"].compact.join('_')
end

#extension_white_listObject



26
27
28
# File 'app/uploaders/xhive/image_uploader.rb', line 26

def extension_white_list
  %w(jpg jpeg gif png)
end

#store_dirObject



10
11
12
# File 'app/uploaders/xhive/image_uploader.rb', line 10

def store_dir
  "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end

#urlObject



18
19
20
# File 'app/uploaders/xhive/image_uploader.rb', line 18

def url
  super.gsub('+', '%2B')
end