Module: CarrierWave::Uploader::DefaultPath

Defined in:
lib/carrierwave/uploader/default_path.rb

Instance Method Summary collapse

Instance Method Details

#default_pathObject

Override this method in your uploader to provide a default path in case no file has been cached/stored yet.



19
# File 'lib/carrierwave/uploader/default_path.rb', line 19

def default_path; end

#initialize(*args) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/carrierwave/uploader/default_path.rb', line 7

def initialize(*args)
  super
  if default_path
    @file = CarrierWave::SanitizedFile.new(File.expand_path(default_path, public))
    def @file.blank?; true; end
  end
end