Acording to SQL ISO standard, boolean types are "CRUDed" as:
TRUE - FALSE
However, Mysql doesn't have real support for boolean types, instead
using a patched way of tinyint.
Not surprising that most users use this database engine, the code
developed to interact with databases is first made with Mysql in
mind.
So, AS doesn't have problems with this since most of it is handled via
ActiveRecord, but there's some harcoded SQL in it. Particulary, this
mistakes reflect on 2 parts/files:

1.- the search_ui (search_column_helpers.rb: line
106:active_scaffold_search_boolean)
2.- the finder constructor (finder.rb: condition_for_column, line 39)

However, Mysql supports SQL ISO standard for this, so, switching the
code to SQL standard makes it work for all database engines:

in search_column_helpers.rb, lines 109 and 110:
 select_options << [as_(:true), true]
 select_options << [as_(:false), false]

in finder.rb, line 39:
["#{column.search_sql} = ?", value.to_s]

I'm currently working with Postgresql, and works fine that way. I
don't have mysql to test it, but i checked mysql docs, and it says it
works ok that way.
I would Looove to diff it on github, but i'm still learning git, so
this is kind of a fixme+pull request

thanks for reading :)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

  • AS... naaano
    • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
      • ... Kenny Ortmann

Reply via email to