From 9699b4115943ba16ce648a7f8e24541144597ad4 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 26 Sep 2016 01:04:58 +0800 Subject: [PATCH] make requestinvite controller method explicit --- app/controllers/main_controller.rb | 12 +++++++++++- app/policies/main_policy.rb | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index f89b6b78..d655ea91 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true class MainController < ApplicationController + before_action :authorize_main after_action :verify_authorized after_action :verify_policy_scoped, only: [:home] # GET / def home - authorize :Main respond_to do |format| format.html do if !authenticated? @@ -17,4 +17,14 @@ class MainController < ApplicationController end end end + + # GET /request + def requestinvite + end + + private + + def authorize_main + authorize :Main + end end diff --git a/app/policies/main_policy.rb b/app/policies/main_policy.rb index 1c7a00e5..2eb5b3e8 100644 --- a/app/policies/main_policy.rb +++ b/app/policies/main_policy.rb @@ -3,4 +3,8 @@ class MainPolicy < ApplicationPolicy def home? true end + + def requestinvite? + true + end end