This commit is contained in:
Marie-Élise 2018-02-16 12:24:08 +00:00 committed by GitHub
commit f9060f4fb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,7 +57,9 @@ module Admin
def mass_upload
errors = Commercial.read_file(params[:file]) if params[:file]
if errors.all? { |_k, v| v.blank? }
if errors.nil?
flash[:error] = 'No file detected. Please attach a file.'
elsif errors.all? { |_k, v| v.blank? }
flash[:notice] = 'Successfully added commercials.'
else
errors_text = ''