Related to ActiveRecord issue: rails/rails#9170
Quote integers in postgres
Seems like this should really be in to_sql. If comparing on a numeric column we wouldn't quote, if not, we would. Related: #162. I'm on both of these (well, this but in to_sql, and with tests). @tenderlove, what say you?
You're right. This is actually in to_sql right already: https://github.com/rails/arel/blob/master/lib/arel/visitors/to_sql.rb#L556-L557 but it's not quoted.
I've putted fix into PostgreSQL as I wasn't sure (and I'm still) not how this will affect other DBMS.
I wasn't aware of the #162 though. There's proper solution to my problem. I think this PR can be closed and it would be awesome to merge it as it's needed to solve Rails issue fully. Sorry for the mess ;)
Without a change that quotes these two types, the visit in #162 wouldn't change anything, since the literal visitation method passes them through unchanged.
Yes, but in #162 there's a change from literal to quoted for there two types: https://github.com/rails/arel/pull/162/files#L0R588
Oh. My bad. Forgot.