Module: AttachmentSan::Initializer

Defined in:
lib/attachment_san.rb

Instance Method Summary collapse

Instance Method Details

#attachment_san(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/attachment_san.rb', line 7

def attachment_san(options = {})
  include AttachmentSan
  
  opt = self.attachment_san_options = {
    :public_base_path => '',
    :extension        => :keep_original,
    :filename_scheme  => :variant_name
  }.merge(options)
  # Defaults :base_path to expanded :public_base_path.
  opt[:base_path] ||= Rails.root + File.join('public', opt[:public_base_path])
  opt
end