def attachment_from_params(uploaded_file_or_hash)
        filename, content = if Hash === uploaded_file_or_hash
                              [uploaded_file_or_hash[:filename], uploaded_file_or_hash[:tempfile].read]
                            else
                              [uploaded_file_or_hash.original_filename, uploaded_file_or_hash.read]
                            end

        {
          :filename => filename,
          :content => content
        }
      end
def attachment_from_params(uploaded_file_or_hash)
        filename, content = if Hash === uploaded_file_or_hash
                              [uploaded_file_or_hash[:filename], uploaded_file_or_hash[:tempfile].read]
                            else
                              [uploaded_file_or_hash.original_filename, uploaded_file_or_hash.read]
                            end

        {
          :filename => filename,
          :content => content
        }
      end
Protected: Normalize file from params

 uploaded_file_or_hash - ActionController::UploadedFile,
                         ActionDispatch::Http::UploadedFile, or Hash

 Returns Hash for Mail::Message#add_file