Class: Dorsale::Alexandrie::Attachment

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/dorsale/alexandrie/attachment.rb

Instance Method Summary collapse

Instance Method Details

#download_filenameObject



20
21
22
23
24
25
26
# File 'app/models/dorsale/alexandrie/attachment.rb', line 20

def download_filename
  if File.extname(file_identifier) == File.extname(name)
    name
  else
    name.parameterize + File.extname(file_identifier)
  end
end

#set_default_nameObject



16
17
18
# File 'app/models/dorsale/alexandrie/attachment.rb', line 16

def set_default_name
  self.name = file_identifier if name.blank?
end