Sha256: 5e3ea037a82ff2021cfda4b7040074b0123fc9ef1d4a3ad82c5a90e4fb70a481

Contents?: true

Size: 367 Bytes

Versions: 10

Compression:

Stored size: 367 Bytes

Contents

# encoding: utf-8

module Locomotive
  class EditableFileUploader < ::CarrierWave::Uploader::Base

    include ::CarrierWave::MimeTypes

    process :set_content_type

    def store_dir
      self.build_store_dir('sites', model.page.site_id, 'pages', model.page.id, 'files')
    end

    def image?
      self.file ? self.file.content_type : false
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
locomotivecms-3.0.0 app/uploaders/locomotive/editable_file_uploader.rb
locomotivecms-3.0.0.rc7 app/uploaders/locomotive/editable_file_uploader.rb
locomotivecms-3.0.0.rc6 app/uploaders/locomotive/editable_file_uploader.rb
locomotivecms-3.0.0.rc5 app/uploaders/locomotive/editable_file_uploader.rb
locomotivecms-3.0.0.rc4 app/uploaders/locomotive/editable_file_uploader.rb
locomotivecms-3.0.0.rc3 app/uploaders/locomotive/editable_file_uploader.rb
locomotivecms-3.0.0.rc2 app/uploaders/locomotive/editable_file_uploader.rb
locomotivecms-3.0.0.rc1 app/uploaders/locomotive/editable_file_uploader.rb
locomotivecms-3.0.0.pre.beta.1 app/uploaders/locomotive/editable_file_uploader.rb
locomotivecms-3.0.0.pre.alpha.3 app/uploaders/locomotive/editable_file_uploader.rb