You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
DataObjects::SyntaxError: ERROR: missing FROM-clause entry for table "users"
LINE 1: ... "problems" INNER JOIN "problems" "problems_1" ON "users"."i...
^
(code: 16908420, sql state: 42P01, query: SELECT "problems"."user_id", COUNT("problems"."id") FROM "problems" INNER JOIN "problems" "problems_1" ON "users"."id" = "problems_1"."user_id" GROUP BY "problems"."user_id" ORDER BY "problems"."user_id", uri: postgres:tpitale@localhostdocket_development?adapter=postgres&username=tpitale&password=&host=localhost&database=docket_development&path=docket_development)
from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/adapters/dm-do-adapter.rb:20:in execute_reader' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/adapters/dm-do-adapter.rb:20:inblock in aggregate'
from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in with_connection' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/adapters/dm-do-adapter.rb:14:inaggregate'
from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/repository.rb:8:in aggregate' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/functions.rb:183:inaggregate'
from (irb):1
from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/railties-3.0.8/lib/rails/commands/console.rb:44:in start' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/railties-3.0.8/lib/rails/commands/console.rb:8:instart'
from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/railties-3.0.8/lib/rails/commands.rb:23:in <top (required)>' from script/rails:6:inrequire'
from script/rails:6:in `
'
The SQL generated is strange indeed:
SELECT "problems"."user_id", COUNT("problems"."id") FROM "problems" INNER JOIN "problems" "problems_1" ON "users"."id" = "problems_1"."user_id" GROUP BY "problems"."user_id" ORDER BY "problems"."user_id"
I would expect SELECT "problems"."user_id", COUNT("problems"."id") FROM "problems", "users" WHERE "users"."id" = "problems"."user_id" GROUP BY "problems"."user_id" ORDER BY "problems"."user_id"
The text was updated successfully, but these errors were encountered:
Problem.aggregate(:id.count, :fields => [:user_id], :unique => true, :links => [:user])
Will break like so:
DataObjects::SyntaxError: ERROR: missing FROM-clause entry for table "users"
'LINE 1: ... "problems" INNER JOIN "problems" "problems_1" ON "users"."i...
^
(code: 16908420, sql state: 42P01, query: SELECT "problems"."user_id", COUNT("problems"."id") FROM "problems" INNER JOIN "problems" "problems_1" ON "users"."id" = "problems_1"."user_id" GROUP BY "problems"."user_id" ORDER BY "problems"."user_id", uri: postgres:tpitale@localhostdocket_development?adapter=postgres&username=tpitale&password=&host=localhost&database=docket_development&path=docket_development)
from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/adapters/dm-do-adapter.rb:20:in
execute_reader' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/adapters/dm-do-adapter.rb:20:in
block in aggregate'from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in
with_connection' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/adapters/dm-do-adapter.rb:14:in
aggregate'from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/repository.rb:8:in
aggregate' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/dm-aggregates-1.1.0/lib/dm-aggregates/functions.rb:183:in
aggregate'from (irb):1
from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/railties-3.0.8/lib/rails/commands/console.rb:44:in
start' from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/railties-3.0.8/lib/rails/commands/console.rb:8:in
start'from /Users/tpitale/.rvm/gems/ruby-1.9.2-p180@docket/gems/railties-3.0.8/lib/rails/commands.rb:23:in
<top (required)>' from script/rails:6:in
require'from script/rails:6:in `
The SQL generated is strange indeed:
SELECT "problems"."user_id", COUNT("problems"."id") FROM "problems" INNER JOIN "problems" "problems_1" ON "users"."id" = "problems_1"."user_id" GROUP BY "problems"."user_id" ORDER BY "problems"."user_id"
I would expect
SELECT "problems"."user_id", COUNT("problems"."id") FROM "problems", "users" WHERE "users"."id" = "problems"."user_id" GROUP BY "problems"."user_id" ORDER BY "problems"."user_id"
The text was updated successfully, but these errors were encountered: