test/support/dummy/app/controllers/admin/dashboard_controller.rb in simple_auth-3.0.0 vs test/support/dummy/app/controllers/admin/dashboard_controller.rb in simple_auth-3.1.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require_relative "../application_controller"
module Admin
class DashboardController < ::ApplicationController
before_action :require_logged_admin, only: "index"
@@ -24,12 +26,10 @@
user = User.create!(admin: true, password: "test")
user_session.record = user
head :ok
end
- private
-
- def authorized?
+ private def authorized?
current_admin.present? || current_user.admin?
end
end
end