test/support/dummy/app/controllers/dashboard_controller.rb in simple_auth-3.0.0 vs test/support/dummy/app/controllers/dashboard_controller.rb in simple_auth-3.1.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
class DashboardController < ApplicationController
before_action :require_logged_user, except: %w[log_in not_logged]
before_action :redirect_logged_user, only: "not_logged"
def index
@@ -13,11 +15,9 @@
def not_logged
head :ok
end
- private
-
- def authorized_user?
+ private def authorized_user?
current_user.try(:email).to_s.match(/@example.com\z/)
end
end