Class: CarrierWave::Uploader::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/locomotive/carrierwave/base.rb,
lib/locomotive/carrierwave/patches.rb

Instance Method Summary collapse

Instance Method Details

#build_store_dir(*args) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/locomotive/carrierwave/patches.rb', line 18

def build_store_dir(*args)
  default_dir = self.class.store_dir

  if default_dir.blank? || default_dir == 'uploads'
    File.join(args.map(&:to_s))
  else
    File.join([default_dir] + args.map(&:to_s))
  end
end

#to_labelObject



5
6
7
# File 'lib/locomotive/carrierwave/base.rb', line 5

def to_label
  File.basename(self.to_s, File.extname(self.to_s))
end

#to_liquidObject



9
10
11
# File 'lib/locomotive/carrierwave/base.rb', line 9

def to_liquid
  Locomotive::Liquid::Drops::Uploader.new(self)
end