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



24
25
26
27
28
29
30
# File 'app/models/dorsale/alexandrie/attachment.rb', line 24

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

#set_default_nameObject



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

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