A bit more info...
The Category model is "sefl-referencing" in that a Category can belong
to another Category and can therefore have categories.
class Category < ActiveRecord::Base
set_table_name "category"
set_primary_key "category_id"
belongs_to :exercise
belongs_to :parent_category, :class_name => 'Category', :foreign_key
=> 'parent_id'
has_many :categories, :class_name => 'Category', :foreign_key =>
'parent_id', :order => "position", :dependent => :destroy
...
end
Don't know if this has any bearing, but other Models (where sorting is
working) do not self-reference like this.
Also, if this is in the Controller it works...
active_scaffold :category do |c|
c.list.columns = [:position, :name, :code, :categories]
list.sorting = {:categories => 'asc'} # <=== categories
works, :position and :name
...
end
Also, the invalid clause has this...
"SELECT DISTINCT category.category_id "
...is selecting from an identity field, so it doesn't need the
DISTINCT.
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---