Skip to content

Commit

Permalink
Merge pull request #52 from ZeusWPI/fix/51/users-can-approve-their-ow…
Browse files Browse the repository at this point in the history
…n-requests

Make sure Cancancan actually finds the resource to authorize it
  • Loading branch information
redfast00 committed May 31, 2019
2 parents 13bf57d + 756cd09 commit 923c1ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 923c1ab

Please sign in to comment.