Sha256: 0d6891d63580a1af35a96518915247abceca07ae4f277e833db4bd794058fc18

Contents?: true

Size: 522 Bytes

Versions: 8

Compression:

Stored size: 522 Bytes

Contents

# encoding: utf-8

module CarrierWave
  module Uploader
    module DefaultPath

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

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

    end # DefaultPath
  end # Uploader
end # CarrierWave

Version data entries

8 entries across 8 versions & 4 rubygems

Version Path
andrewtimberlake-carrierwave-0.3.2.1 lib/carrierwave/uploader/default_path.rb
durran-carrierwave-0.3.2.3 lib/carrierwave/uploader/default_path.rb
jnicklas-carrierwave-0.3.2.1 lib/carrierwave/uploader/default_path.rb
jnicklas-carrierwave-0.3.2 lib/carrierwave/uploader/default_path.rb
jnicklas-carrierwave-0.3.3 lib/carrierwave/uploader/default_path.rb
carrierwave-0.3.4 lib/carrierwave/uploader/default_path.rb
carrierwave-0.3.3 lib/carrierwave/uploader/default_path.rb
carrierwave-0.3.2 lib/carrierwave/uploader/default_path.rb