Closed dparis closed 11 years ago
Fixed in 362a2044e41e1ae1eb2dbb5444ade247ca1c5baa for master and ec829d12d87326b1d9ac0e0211a7ee05e0a45d73 for rails3 branch.
Thanks for the fix. :smile:
Has the rails3 branch been updated on rubygems?
Not yet. You'll have to point your Gemfile at github for now.
When running an AR query like:
or
Postgres returns an error about an ambiguous reference to the id field. This stems from how the
subquery_sql
method builds the subquery usingcolumns.map(...)
here: https://github.com/JackC/surus/blob/master/lib/surus/json/query.rb#L17Are there any clever ways to form the AR query to remove the ambiguity, or does subquery_sql just need to be made less naive about the column names? Seems like that module class should have enough info to just prepend the table name to each column entry when building the subquery. Barring any additional join-related query functionality, that seems like it should be enough to make these two methods behave as expected.
Cheers!