Use `SQLTree#to_sql` instead of `arel.to_sql`

Because sometimes `arel.to_sql` requires bind values and
activerecord raises error if empty bind values.