NUBIC/surveyor — Issue #274: Postgres ActiveRecord::StatementInvalid
Author: justinhammack
Created: 2012-02-02 06:24:13+00:00
State: open

Runs fine on sqlite3, but on pg I get the following error: ActiveRecord::StatementInvalid

Details Below

```
ActiveRecord::StatementInvalid in Surveyor#edit

Showing /Users/NRML/.rvm/gems/ruby-1.9.2-p290/gems/surveyor-0.21.0/app/views/partials/_question.html.haml where line #4 raised:

PGError: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...ers" WHERE "answers"."question_id" = 48 ORDER BY display_or...
^
: SELECT DISTINCT "answers".id FROM "answers" WHERE "answers"."question_id" = 48 ORDER BY display_order ASC
Extracted source (around line #4):

1: -# TODO: js for slider
2: - rg ||= nil
3: - renderer = q.renderer(g ||= nil)
4: = f.inputs q_text(q), :id => rg ? "q_#{q.id}_#{rg}" : "q_#{q.id}", :class => "q_#{renderer} #{q.css_class(@response_set)}" do
5: %span.help= q.help_text
6: - case renderer
7: - when :image, :label
Trace of template inclusion: /Users/NRML/.rvm/gems/ruby-1.9.2-p290/gems/surveyor-0.21.0/app/views/partials/_section.html.haml, /Users/NRML/.rvm/gems/ruby-1.9.2-p290/gems/surveyor-0.21.0/app/views/surveyor/edit.html.haml

Rails.root: /Users/NRML/Dropbox/code/wineFollyAPP
'''