On Lunes, 18 de Octubre de 2010 12:10:11 Iñaki Baz Castillo escribió:
> Hi, I've a column which is char(1). Entries have these possible values:
>
> - "U"
> - "R"
> - "P"
> - "" <--- empty string
>
> In the controller I show a select:
>
> config.columns[:Status_Flag].form_ui = :select
> config.columns[:Status_Flag].options = {:options =>
> [
> ["-: Permitido (pass through)", ""],
> ["P: Permitido (pass through)", "P"],
> ["R: Forzado (restricted)", "R"],
> ["U: Prohibido (unrestricted)", "U"]
> ]
> }
>
>
> When searching entries with value "P" I see this query (it works):
>
> SELECT `clis`.* FROM `clis` WHERE (((Status_Flag in ('P')))) ...
>
> But when I search for entries with value "" the query is "wrong":
>
> SELECT `clis`.* FROM `clis` ...
>
> This is, there is no filter in the search. How could I solve it?
>
> Thanks a lot.
I'm not sure how to work around this case, when a field is empty no condition
is generated for that field, because is not required filter by all fields.
Maybe
checking for condition_for_#{column.name}_column could be moved above checking
blank value. Are you using master branch?
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 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.