Skip to content

Commit

Permalink
Make sure Cancancan actually finds the resource to authorize it
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNaessens committed May 31, 2019
1 parent 13bf57d commit 756cd09
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 756cd09

Please sign in to comment.