Class: BoltonCms::AttachmentUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Includes:
CarrierWave::MimeTypes, CarrierWave::MiniMagick
Defined in:
lib/bolton_cms/attachment_uploader.rb

Instance Method Summary collapse

Instance Method Details

#cache_dirObject



11
12
13
# File 'lib/bolton_cms/attachment_uploader.rb', line 11

def cache_dir
  "#{Padrino.root}/public/#{mounted_as}-cache"
end

#dyn_resize_fill(options) ⇒ Object



45
46
47
# File 'lib/bolton_cms/attachment_uploader.rb', line 45

def dyn_resize_fill(options)
  resize_to_fill options['width'], options['height'], model.gravity
end

#dyn_resize_fit(options) ⇒ Object



41
42
43
# File 'lib/bolton_cms/attachment_uploader.rb', line 41

def dyn_resize_fit(options)
  resize_to_fit options['width'], options['height']
end

#dyn_resize_limit(options) ⇒ Object



37
38
39
# File 'lib/bolton_cms/attachment_uploader.rb', line 37

def dyn_resize_limit(options)
  resize_to_limit options['width'], options['height']
end

#dyn_resize_pad(options) ⇒ Object



49
50
51
# File 'lib/bolton_cms/attachment_uploader.rb', line 49

def dyn_resize_pad(options)
  resize_and_pad options['width'], options['height'], (options['background'] || :transparent), model.gravity
end

#extension_white_listObject



16
17
18
# File 'lib/bolton_cms/attachment_uploader.rb', line 16

def extension_white_list
  %w(jpg jpeg gif png)
end

#store_dirObject



8
9
10
# File 'lib/bolton_cms/attachment_uploader.rb', line 8

def store_dir
  "#{Padrino.root}/public/#{mounted_as}/#{model.page.id}"
end