Skip to content

Commit

Permalink
Sorting of specialities for department head
Browse files Browse the repository at this point in the history
  • Loading branch information
Envek committed Mar 13, 2012
1 parent 7ed3d8c commit dac4118
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/dept_head/specialities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dac4118

Please sign in to comment.