def filename
      return unless original_filename

      filename = if model.respond_to?("#{mounted_as}_filename")
                   model.send("#{mounted_as}_filename")
                 else
                   model.title.parameterize
                 end

      # Safe-guard against customized filename methods or parameterize returning an empty string
      return original_filename if filename.blank?

      "#{filename}.#{file.extension}"
    end
def filename
      return unless original_filename

      filename = if model.respond_to?("#{mounted_as}_filename")
                   model.send("#{mounted_as}_filename")
                 else
                   model.title.parameterize
                 end

      # Safe-guard against customized filename methods or parameterize returning an empty string
      return original_filename if filename.blank?

      "#{filename}.#{file.extension}"
    end
# Content types which are allowed to be uploaded.
 def content_type_whitelist
   /image\//
 end
 Override the filename of the uploaded files