RecordSelect current master, AS current master, :include not working?

31 views
Skip to first unread message

Atastor

unread,
Dec 12, 2012, 8:20:24 AM12/12/12
to actives...@googlegroups.com
Give AS and RecordSelect (Sergios branch) current masters; I can't bring the following config to live:

class AgeClassDisciplinesController < ApplicationController
  record_select :include => [:age_class, :discipline], :search_on => ['age_classes.keywords', 'disciplines.keywords']

Typing in the rs-form-field only results in:

(0.4ms)  SELECT COUNT(*) FROM "age_class_disciplines" WHERE ((age_classes.keywords LIKE 'M7%' OR disciplines.keywords LIKE 'M7%'))
SQLite3::SQLException: no such column: age_classes.keywords: SELECT COUNT(*) FROM "age_class_disciplines"  WHERE ((age_classes.keywords LIKE 'M7%' OR disciplines.keywords LIKE 'M7%'))

Apparently the :include ist silently ignored, as there is no join in the sql statement ... everything else is working fine, i.e. using rs to search for plain attributes etc.

Anybody sees anything obviously wrong?

Regards
Michael

Sergio Cambra

unread,
Dec 12, 2012, 10:53:46 AM12/12/12
to actives...@googlegroups.com
:include is not used in count query, never was used. You must define
record_select_includes, which is used in both queries, count and select

Atastor

unread,
Dec 13, 2012, 3:44:35 AM12/13/12
to actives...@googlegroups.com
Okaaayyyy...perhaps I was to naive; I was hoping that the ":include => ..." stuff –put into the recordselect config according to the googlewiki– was sufficient for the recordselect configuration, and that active_scaffold would pick this up and behave accordingly.

Overriding with a controller method works like a charm, thanks! I'll put this in the as-wiki, as the count statements are mostly auto generated by AS.

KRM

Atastor

unread,
Dec 13, 2012, 3:54:31 AM12/13/12
to actives...@googlegroups.com

Sergio Cambra

unread,
Dec 13, 2012, 4:47:58 AM12/13/12
to actives...@googlegroups.com
RecordSelect needs documentation, google wiki is very very old, I don't
remember when :include was changed to be used only for select, or maybe it
always was like that.
Reply all
Reply to author
Forward
0 new messages