This repository was archived by the owner on Jul 24, 2020. It is now read-only.
File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ class ApplicationController < ActionController::Base
17
17
c . before_filter :cart
18
18
c . before_filter :fix_cart_date
19
19
c . before_filter :set_view_mode
20
+ c . before_filter :check_view_mode
20
21
end
21
22
22
23
helper_method :current_user
@@ -100,11 +101,11 @@ def check_active_admin_permission
100
101
end
101
102
102
103
def check_view_mode
103
- if current_user . role == 'admin' && current_user . view_mode != 'admin'
104
- flash [ :persistent ] = "Currently viewing as #{ current_user . view_mode } user. You can switch back to your regular view \
105
- #{ ActionController ::Base . helpers . link_to ( 'below' , '#view_as' ) } \
106
- (see #{ ActionController ::Base . helpers . link_to ( 'here' , 'https://yalestc.github.io/reservations/' ) } for details)."
107
- end
104
+ if current_user . role == 'admin' && current_user . view_mode != 'admin'
105
+ flash [ :persistent ] = "Currently viewing as #{ current_user . view_mode } user. You can switch back to your regular view \
106
+ #{ ActionController ::Base . helpers . link_to ( 'below' , '#view_as' ) } \
107
+ (see #{ ActionController ::Base . helpers . link_to ( 'here' , 'https://yalestc.github.io/reservations/' ) } for details)."
108
+ end
108
109
end
109
110
110
111
def fix_cart_date
You can’t perform that action at this time.
0 commit comments