Class: Locomotive::EditableFileUploader

Inherits:
CarrierWave::Uploader::Base show all
Includes:
CarrierWave::MimeTypes
Defined in:
app/uploaders/locomotive/editable_file_uploader.rb

Instance Method Summary collapse

Methods inherited from CarrierWave::Uploader::Base

#build_store_dir, #to_label, #to_liquid

Methods included from CarrierWave::Uploader::Base64Download

#download!

Instance Method Details

#image?Boolean

Returns:



14
15
16
17
18
# File 'app/uploaders/locomotive/editable_file_uploader.rb', line 14

def image?
  if self.file.exists?
    self.file.content_type.start_with?('image')
  end
end

#store_dirObject



10
11
12
# File 'app/uploaders/locomotive/editable_file_uploader.rb', line 10

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