Sha256: e12266b6d6d53fbf83743a34cb46bbb3d64786a6d9367926f7cfbc637e81f65a

Contents?: true

Size: 1.28 KB

Versions: 16

Compression:

Stored size: 1.28 KB

Contents

CarrierWave.configure do |config|
  config.cache_dir = Rails.root.join 'tmp/uploads'
end

#------------------------------------------------------------------------------
# Put the version name at the end of the file, instead of beginning
# https://github.com/carrierwaveuploader/carrierwave/wiki/How-To:-Move-version-name-to-end-of-filename,-instead-of-front
#------------------------------------------------------------------------------
module CarrierWave
  module Uploader
    module Versions
      def full_filename(for_file)
        parent_name = super(for_file)
        ext         = File.extname(parent_name)
        base_name   = parent_name.chomp(ext)
        [base_name, version_name].compact.join('_') + ext
      end

      def full_original_filename
        parent_name = super
        ext         = File.extname(parent_name)
        base_name   = parent_name.chomp(ext)
        [base_name, version_name].compact.join('_') + ext
      end
    end
  end
end

#--- allow the '@' in a file name, to support retina image naming conventions
CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+\@]/

#--- carrierwave only loads english locale by default.  pull in the other locales
I18n.load_path += Dir.glob( Gem.loaded_specs['carrierwave'].full_gem_path + "/lib/carrierwave/locale/*.yml" ) 

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_core-4.2.3.10 config/initializers/carrierwave.rb
dm_core-4.2.3.9 config/initializers/carrierwave.rb
dm_core-4.2.3.8 config/initializers/carrierwave.rb
dm_core-4.2.3.7 config/initializers/carrierwave.rb
dm_core-4.2.3.6 config/initializers/carrierwave.rb
dm_core-4.2.3.5 config/initializers/carrierwave.rb
dm_core-4.2.3.4 config/initializers/carrierwave.rb
dm_core-4.2.3.3 config/initializers/carrierwave.rb
dm_core-4.2.3.2 config/initializers/carrierwave.rb
dm_core-4.2.3.1 config/initializers/carrierwave.rb
dm_core-4.2.3 config/initializers/carrierwave.rb
dm_core-4.2.2.3 config/initializers/carrierwave.rb
dm_core-4.2.2.2 config/initializers/carrierwave.rb
dm_core-4.2.2.1 config/initializers/carrierwave.rb
dm_core-4.2.2 config/initializers/carrierwave.rb
dm_core-4.2.1.5 config/initializers/carrierwave.rb