@@ -8,7 +8,6 @@ class FacilitiesController < ApplicationController
88 before_action :check_acting_as , except : [ :index , :show ]
99 before_action :load_order_details , only : [ :confirm_transactions , :move_transactions , :reassign_chart_strings ]
1010 before_action :set_admin_billing_tab , only : [ :confirm_transactions , :disputed_orders , :movable_transactions , :transactions ]
11- before_action :set_recently_used_facilities , only : [ :index ]
1211 before_action :store_fullpath_in_session , only : [ :index , :show ]
1312
1413 load_and_authorize_resource find_by : :url_name
@@ -23,11 +22,6 @@ class FacilitiesController < ApplicationController
2322 action_name . in? ( %w( disputed_orders movable_transactions transactions ) ) ? "two_column_head" : "two_column"
2423 }
2524
26- def set_recently_used_facilities
27- @recently_used_facilities =
28- acting_user . present? && acting_user . recently_used_facilities . sorted
29- end
30-
3125 cattr_accessor ( :facility_homepage_redirector ) { DefaultFacilityHomepageRedirector }
3226
3327 # GET /facilities/:facility_url/dashboard
@@ -37,8 +31,10 @@ def dashboard
3731
3832 # GET /facilities
3933 def index
40- @facilities = Facility . active . sorted
34+ @facilities = Facility . active . alphabetized
35+ @recently_used_facilities = MostRecentlyUsedSearcher . new ( acting_user ) . recently_used_facilities . alphabetized
4136 @active_tab = "home"
37+ @recent_products = MostRecentlyUsedSearcher . new ( acting_user ) . recently_used_products . includes ( :facility ) . alphabetized
4238 render layout : "application"
4339 end
4440
@@ -57,7 +53,7 @@ def list
5753 # show list of operable facilities for current user, and admins manage all facilities
5854 @active_tab = "manage_facilites"
5955 if session_user . administrator?
60- @facilities = Facility . sorted
56+ @facilities = Facility . alphabetized
6157 flash . now [ :notice ] = "No facilities have been added" if @facilities . empty?
6258 else
6359 @facilities = operable_facilities
0 commit comments