Hi Sergio, This generated order clause is without any sorting from the UI, this should not have the twice columns on generated SQL.
I think when I sort from the UI this could be: table.ui_column ASC|DESC, table.default_scope_column ASC|DESC 2009/9/25 Sergio Cambra .:: entreCables S.L. ::. <[email protected]> > > On Jueves, 24 de Septiembre de 2009 23:57:53 G. Sobrinho escribió: > > Hi, > > > > Looking at AS I see the AS has support for default_scope now. I have a > > model named Page with acts_as_list. So, I setted the default scope: > > > > default_scope :order => 'position ASC' > > > > > > But looking at generated SQL by AS I see that: > > > > Nested: Page Load (17.6ms) SELECT "pages".* FROM "pages" WHERE > > (((pages.category_id = '1'))) ORDER BY pages."position" ASC, position ASC > > LIMIT 15 OFFSET 0 > > Direct: Page Load (3.9ms) SELECT "pages".* FROM "pages" ORDER BY > > pages."position" ASC, position ASC LIMIT 15 OFFSET 0 > > We could build an order clause like rails, without including table name, or > update default_scope with the clause ActiveScaffold builds. But when you > change > the sorting in the UI order from default_scope will be added again. > > > > > > > Another thing is Rails accepts the order option a symbol value and AS > > doesn't. This mean: > > > > default_scope :order => :position > > I have fixed this. > > -- > Sergio Cambra .:: entreCables S.L. ::. > Mariana Pineda 23, 50.018 Zaragoza > T) 902 021 404 F) 976 52 98 07 E) [email protected] > > > > > -- Cordialmente, Gabriel Sobrinho Diretor de desenvolvimento Hite - Comunicação Digital e Mídia Interativa http://www.hite.com.br/ +55 31 8775 8378 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
