How to use Rails with uppercase column name?
问题 I have the following as part of an AR query: .having('COUNT(foo.id) > bar.maxUsers') This generates an error: ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column bar.maxusers does not exist ^ HINT: Perhaps you meant to reference the column "bar.maxUsers". I am referencing the column bar.maxUsers . So, apparently AR downcases the query. How to suppress this behavior? Rails 4.2.10 PostgreSQL EDIT: SQL: SELECT ... HAVING COUNT(foo.id) > bar.maxUsers So it is happening after the to