Got it. Looked through the source and found the very helpful
joins_for_collection just waiting to be over-ridden.

Here is the working controller code:

#(report belongs to user belongs to region)

def joins_for_collection
  [:user => :region]   # not sure if [{:user => :region}] is better
end

def conditions_for_collection
  if current_user.region
    @region_list = current_user.region.self_and_descendants.collect {|
x| x.name}
    [ "regions.name IN (?)", @region_list]
  end
end

-- 
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