How should I rewrite an if-return-else condition in the middle of this function?
def import_excel_to_database(xls_file_path)
q_param = { report_type:report_type, item:product, exchange:exchange, product_exchange:row[0], date: row[2]} # timestamp_utc: row[2].strftime('%Q').to_i
# if exsisted then return or continue the remaining
if ImportHistory.where(q_param).exists?
return false
else
ImportHistory.create(q_param)
end
xls = Roo::Excel.new(xls_file_path)
xls.default_sheet = xls.sheets[0]
columns = get_columns(xls.row(1))
iterate_data_rows(xls_file_path, xls, columns)
end