lib/generators/admin/install/templates/controllers/admin/base_controller.rb in administration-zero-1.0.2 vs lib/generators/admin/install/templates/controllers/admin/base_controller.rb in administration-zero-1.0.3
- old
+ new
@@ -1,13 +1,13 @@
class Admin::BaseController < ActionController::Base
include Pagy::Backend
- before_action :set_time_zone
+ around_action :set_time_zone
before_action :authenticate
private
def set_time_zone
- Time.zone = cookies[:time_zone]
+ Time.use_zone(cookies[:time_zone]) { yield }
end
def authenticate
if user = Admin::User.find_by_id(session[:admin_user_id])
Admin::Current.user = user