From dac41189e092a2acb614959cb84fd1876c56213d Mon Sep 17 00:00:00 2001 From: Novikov Andrey Date: Tue, 13 Mar 2012 11:43:11 +1000 Subject: [PATCH] Sorting of specialities for department head --- app/controllers/dept_head/specialities_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/dept_head/specialities_controller.rb b/app/controllers/dept_head/specialities_controller.rb index 410dcba..8510621 100644 --- a/app/controllers/dept_head/specialities_controller.rb +++ b/app/controllers/dept_head/specialities_controller.rb @@ -4,7 +4,6 @@ class DeptHead::SpecialitiesController < DeptHead::BaseController active_scaffold do |config| config.actions << :delete config.columns = [:code, :name] - config.list.sorting = {:code => :asc} config.nested.add_link('Группы', [:groups]) config.action_links.add :teaching_plan, :label => "Учебный план", :type => :member, :page => true config.action_links.add :teaching_plan_import, :label => "Импорт учебного плана", :type => :collection, :page => true @@ -78,6 +77,10 @@ def conditions_for_collection end end + def custom_finder_options + {:order => "department_id = #{current_dept_head.department_id} DESC, code ASC"} + end + def current_user return current_dept_head end