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.



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

def default_path; end

#initialize(*args) ⇒ Object



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

def initialize(*args)
  super
  if default_path
    puts "WARNING: Default Path is deprecated and will be removed in CarrierWave 0.4. Please use default_url instead!"
    @file = CarrierWave::SanitizedFile.new(File.expand_path(default_path, public))
    def @file.blank?; true; end
  end
end