Class: Locomotive::EditableFileUploader

Inherits:
BaseUploader show all
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:



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

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

#store_dirObject



6
7
8
# File 'app/uploaders/locomotive/editable_file_uploader.rb', line 6

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