Bug #1607
closedREST API calls /hosts/:id/puppetclasses fails with postgres
Description
Calling /hosts/:id:puppetclasses fails with postgres.
The SQL request has an ORDER BY clause on a field not selected.
Suggested fix is to remove the default_scope in app/models/puppetclass.rb
Updated by Florent Castelli over 12 years ago
Puppetclass Load (0.7ms) SELECT DISTINCT puppetclasses.id FROM "puppetclasses" INNER JOIN "host_classes" ON "puppetclasses"."id" = "host_classes"."puppetclass_id" INNER JOIN "hosts" ON "hosts"."id" = "host_classes"."host_id" WHERE (hosts.name = 'somehost') ORDER BY LOWER
PG::Error: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...osts.name = 'somehost') ORDER BY LOWER(pupp...
^
: SELECT DISTINCT puppetclasses.id FROM "puppetclasses" INNER JOIN "host_classes" ON "puppetclasses"."id" = "host_classes"."puppetclass_id" INNER JOIN "hosts" ON "hosts"."id" = "host_classes"."host_id" WHERE (hosts.name = 'somehost') ORDER BY LOWER
Updated by Ohad Levy over 12 years ago
- Status changed from New to Need more information
is this still releavant? is this one of the merged pull requests and I just missed this ticket?
Updated by Florent Castelli over 12 years ago
Covered by this patch: https://github.com/theforeman/foreman/pull/55
Updated by Florent Castelli over 12 years ago
- Status changed from Need more information to Closed
- % Done changed from 0 to 100
Applied in changeset cbf4be7cfaee8c2b82c833f0f24e914ab50ef238.