Merge pull request #52 from ZeusWPI/fix/51/users-can-approve-their-own-requests

Make sure Cancancan actually finds the resource to authorize it
This commit is contained in:
redfast00 2019-05-31 02:54:54 +02:00 committed by GitHub
commit 923c1ab286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@ class RequestsController < ApplicationController
load_and_authorize_resource :user, find_by: :name
before_action :load_request, only: [:confirm, :decline]
authorize_resource :request, only: [:confirm, :decline]
authorize_resource :request, id_param: :request_id, only: [:confirm, :decline]
def index
@requests = @user.incoming_requests.group_by(&:status)