def update_where_sql
    sql = "WHERE "

    first = true
    @terms.each do |key, value|