Skip to content

Commit

Permalink
Fix authorize! calls using strings instead of symbols
Browse files Browse the repository at this point in the history
CanCan requires `authorize!` calls to specify the name of the action
as a symbol, if that's how it was specified in the ability.
  • Loading branch information
aldesantis committed Oct 21, 2020
1 parent 204ac4b commit 9ac1fec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def destroy

def load_line_item
@line_item = SolidusSubscriptions::LineItem.find(params[:id])
authorize! action_name, @line_item, subscription_guest_token
authorize! action_name.to_sym, @line_item, subscription_guest_token
end

def line_item_params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def cancel

def load_subscription
@subscription = SolidusSubscriptions::Subscription.find(params[:id])
authorize! action_name, @subscription, subscription_guest_token
authorize! action_name.to_sym, @subscription, subscription_guest_token
end

def subscription_params
Expand Down

0 comments on commit 9ac1fec

Please sign in to comment.