app/models/applications/application_file.rb
# Supplies the filename to use when saving and retrieving this file to the filesystem
Supplies the filename to use when saving and retrieving this file to the filesystem
Supplies the filename to use when saving and retrieving this file to the filesystem
def filename(record, file)
    original = "#{file.basename}.#{file.extension}"
    write_attribute(:original_filename, original)
    ext = file.suffix.nil? || file.suffix == :original ? file.extension : file.suffix
    "#{application_for_offering.id.to_s}-#{title.gsub(/[\s,\.\\\/\*\?\%\:\|\"\'\<\>]?/,'')}.#{ext}"
  end
def filename ( record , file ) original = "#{file.basename}.#{file.extension}" write_attribute ( :original_filename , original ) ext = file . suffix . nil? || file . suffix == :original ? file . extension : file . suffix "#{application_for_offering.id.to_s}-#{title.gsub(/[\s,\.\\\/\*\?\%\:\|\"\'\<\>]?/,'')}.#{ext}" end
Supplies the filename to use when saving and retrieving this file to the filesystem
Supplies the filename to use when saving and retrieving this file to the filesystem
record
file