Hi,

Should be fixed in head.

--
Volker

On Oct 7, 1:42 am, Gabriel Sobrinho <[email protected]>
wrote:
> Hello,
>
> I found a recent ActiveScaffold issue about default scope sorting. I
> have two models Category and News. Into News model, I defined:
>
>         default_scope :joins => :category, :order =>
>         'categories.position ASC, news.date ASC'
>
> When I try to start server (production) I got this error from AS:
>
>         
> /var/rails/maria-da-penha/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/sorting.rb:24:in
>  `add': Could not find column position (ArgumentError)
>
>         from 
> /var/rails/maria-da-penha/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/sorting.rb:119:in
>  `set_sorting_from_order_clause'
>
>         from 
> /var/rails/maria-da-penha/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/sorting.rb:117:in
>  `each'
>
>         from 
> /var/rails/maria-da-penha/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/sorting.rb:117:in
>  `set_sorting_from_order_clause'
>
>         from 
> /var/rails/maria-da-penha/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/sorting.rb:15:in
>  `set_default_sorting'
>
>         from 
> /var/rails/maria-da-penha/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb:14:in
>  `initialize'
>
>         from 
> /var/rails/maria-da-penha/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:181:in
>  `new'
>
>         from 
> /var/rails/maria-da-penha/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb:181:in
>  `method_missing'
>
>         from 
> /var/rails/maria-da-penha/app/controllers/admin/news_controller.rb:5
>
> The line 5 is: config.list.columns = [:category, :title, ...]
>
> Looking at AS I see the "automatic set order" doesn't get the table name
> from order clause in default scope (which create the issue because news
> table doesn't have the position column).
>
> Can you fix that Sergio?
>
> Thanks
>
> --
> Cordialmente,
>
> Gabriel Sobrinho
> Diretor de desenvolvimento
>
> Hite Comunicação Digital e Mídia Interativahttp://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
-~----------~----~----~----~------~----~------~--~---

Reply via email to