Commit 358d87c74781ff68e8a5facaeaf2cccc455ce425

Authored by Antonio Terceiro
1 parent 30dbf4d7

ActionItem937: being more flexible when selecting folders

app/controllers/admin/admin_panel_controller.rb
... ... @@ -51,7 +51,7 @@ class AdminPanelController < AdminController
51 51 end
52 52  
53 53 def set_portal_folders
54   - @portal_folders = environment.portal_community.articles.find_all_by_type('Folder')
  54 + @portal_folders = environment.portal_community.folders
55 55 if request.post?
56 56 env = environment
57 57 folders = params[:folders].map{|fid| Folder.find(:first, :conditions => {:profile_id => env.portal_community, :id => fid})}
... ...
app/models/environment.rb
... ... @@ -553,7 +553,7 @@ class Environment < ActiveRecord::Base
553 553 end
554 554  
555 555 def portal_folders
556   - (settings[:portal_folders] || []).map{|fid| Folder.find(:first, :conditions => {:profile_id => portal_community.id, :id => fid})}
  556 + (settings[:portal_folders] || []).map{|fid| portal_community.articles.find(fid) }
557 557 end
558 558  
559 559 def portal_folders=(folders)
... ...