In rails 3 if I write: Model.from('models') arel generates the following sql:

select "models".* from models

In rails 4 the same arel generates the following sql:

select "models".* from 'models', NULL

The table name is wrapped in quotes and ', NULL' is appended. How do I use arel to give me the same results as in rails 3?

I was leveraging the original behavior so I could run a fairly complex with recursive query against postgres. In rails4, postgres is choking when it gets to the single quote preceding value I give from.

Is there a better way to do a with recursive query? Or, is there a way to query with arel so it works as before?

有帮助吗?

解决方案

This appears to be an incompatibility with the squeel gem (the master branch as of today).

EDIT I've sent a pull request to squeel's master branch. Fixes the issue for me.

EDIT 2: Merged into master

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top