app/contracts/attachments/create_contract.rb
def validate_content_type
      # If the whitelist is empty, assume all files are allowed
      # as before
      unless matches_whitelist?(attachment_whitelist)
        Rails.logger.info { "Uploaded file #{model.filename} with type #{model.content_type} does not match whitelist" }
        errors.add :content_type, :not_whitelisted, value: model.content_type
      end
    end
##
# Validates the content type, if a whitelist is set
Validates the content type, if a whitelist is set
Validates the content type if a whitelist is set
def validate_content_type
      unless matches_whitelist?(attachment_whitelist)
        Rails.logger.info { "Uploaded file #{model.filename} with type #{model.content_type} does not match whitelist" }
        errors.add :content_type, :not_whitelisted, value: model.content_type
      end
    end
def validate_content_type unless matches_whitelist? ( attachment_whitelist ) Rails . logger . info { "Uploaded file #{model.filename} with type #{model.content_type} does not match whitelist" } errors . add :content_type , :not_whitelisted , value : model . content_type end end
Validates the content type, if a whitelist is set
Validates the content type if a whitelist is set
# If the whitelist is empty, assume all files are allowed # as before