its an integer, is the primary key of the column.
I tried using with or without setting
config.columns[:id].form_ui = :numeric
but there's no change.

The piece of code you showed is from condition_for_column, however
that's only used by field_search, and not normal search. I think the
filtering should be also in create_conditions_for_columns which is the
one that normal search uses, not only as a feature, but to avoid this
kind of crashes.

On Jan 19, 5:44 am, "Sergio Cambra .:: entreCables - Symbol Servicios
Informáticos S.L. ::." <[email protected]> wrote:
> El Friday 16 January 2009 17:36:30 naaano escribió:
>
>
>
> > same problem here, but doesn't work:
>
> > config.search.columns = [:id]
>
> > PGError: ERROR:  no existe la función lower(integer)
> > LINE 1: ...arios_guias".id = "guias".destinatario_id WHERE ((LOWER
> > (guia...
> >                                                              ^
> > HINT:  Ninguna función coincide en el nombre y tipos de argumentos.
> > Puede desear agregar conversión explícita de tipos.
>
> > : SELECT count(DISTINCT "guias".id) AS count_all FROM "guias"  LEFT
>
> > OUTER JOIN "buzones" ON "buzones".id = "guias".buzon_id  LEFT OUTER
> > JOIN "buzones" destinatarios_guias ON "destinatarios_guias".id =
> > "guias".destinatario_id WHERE ((LOWER(guias."id") LIKE E'%86%'))
>
> > Looking deeper, i found that
> > ActiveScaffold::Finder::create_conditions_for_columns treats all
> > columns as string behavior. Anyone have seen this?
>
> What is the type of id column?
> This code should be called for integer columns, decimal columns and so on.
>       search_ui = column.search_ui || column.column.type
>       if self.respond_to?("condition_for_#{search_ui}_column")
>         self.send("condition_for_#{search_ui}_column", column, value,
> like_pattern)
>
> Have do you set a search_ui to id column?
>
>
>
>
>
> > On Jan 15, 9:56 am, "G. Sobrinho" <[email protected]> wrote:
> > > It's solve... Thank for support
>
> > > 2009/1/14 Mike Gaffney <[email protected]>
>
> > > > did you try config.search.columns?
>
> > > > G. Sobrinho wrote:
> > > > > Hi all,
>
> > > > > I need a small feature into AS: search by id (into search field).
> > > > > I search for 40 and #40 but this doesnt work... See:
>
> > > > > /SELECT * FROM "atendimentos" WHERE ((LOWER(atendimentos."acidentes")
> > > > > LIKE '%#40%' OR LOWER(atendimentos."alergia_descricao") LIKE '%#40%'
> > > > > OR LOWER(atendimentos."alteracao_audicao_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."alteracao_visao_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."antecedentes_familiares") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."aparelho_circulatorio") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."aparelho_digestivo") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."aparelho_respiratorio") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."atividade_fisica_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."avaliacao_funcionario") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."cansaco_fisico_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."cirurgia_anterior_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."cirurgia_prevista_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."descricao_atestado") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."doenca_cardiologica_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."doenca_endocrino_metabolica_descricao") LIKE
> > > > > '%#40%' OR LOWER(atendimentos."doenca_gastro_intestinal_descricao")
> > > > > LIKE '%#40%' OR LOWER(atendimentos."doenca_neurologica_descricao")
> > > > > LIKE '%#40%' OR LOWER(atendimentos."doenca_osteo_muscular_descricao")
> > > > > LIKE '%#40%' OR LOWER(atendimentos."doenca_pele_descricao") LIKE
> > > > > '%#40%' OR LOWER(atendimentos."doenca_renal_descricao") LIKE '%#40%'
> > > > > OR LOWER(atendimentos."doenca_respiratoria_descricao") LIKE '%#40%'
> > > > > OR LOWER(atendimentos."etilismo_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."ex_fumante_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."exame_medico") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."fumante_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."funcoes_anteriores") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."hernia_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."internacao_previa_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."medicacao_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."queixas") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."recomendacao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."sistema_nervoso_psiquico") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."sistema_osteo_muscular") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."tratamento_descricao") LIKE '%#40%' OR
> > > > > LOWER(atendimentos."varize_descricao") LIKE '%#40%') AND status
> > > > > IN(0,1)) ORDER BY atendimentos."id" ASC LIMIT 15 OFFSET 0
>
> > > > > /
> > > > > I need to get records by id into search field... It's possible?
>
> > > > > Tks in advance
>
> --
> Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
> Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza
> T) 902 021 404 F) 976 52 98 07 E) [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

  • Se... G. Sobrinho
    • ... Mike Gaffney
      • ... G. Sobrinho
        • ... naaano
          • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
            • ... naaano

Reply via email to