On Jueves, 16 de Septiembre de 2010 15:21:29 Iñaki Baz Castillo escribió: > 2010/9/16 Sergio Cambra .:: entreCables S.L. ::. <[email protected]>: > > search_sql is not quoted, I'm not sure if rails quoted conditions string, > > but I don't think so. Default search_sql will be quoted, but if you set > > search_sql AS won't quoted it. > > I set: > > xxxx.search_sql = "db_2.items.Id_Cliente" > > The problem is that, depending on AS version sometimes I see errors > due to the generated query syntax: > > `db_2`.`items.Id_Cliente` > > or sometimes: > > `db_2.items`.Id_Cliente > > Is ActiveRecord adding such ` ? > > Thanks.
Probably, there are only two lines which quote and they are on column initialization, so setting search_sql you override them. You can try a find in script/console to guess whether active record add the quotes. You can try quoting the search_sql string too. xxxx.search_sql = "`db_2`.`items`.`Id_Cliente`" Although that is database specific -- 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.
