Permalink
Browse files

Fetch user off policy

  • Loading branch information...
1 parent 9bdff09 commit 275222311d47c22dd62afea9d7916927e44d8e40 @thomasklemm committed Mar 4, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/pundit.rb
View
@@ -59,7 +59,7 @@ def authorize(record, query=nil)
@_policy_authorized = true
unless policy(record).public_send(query)
e = NotAuthorizedError.new
- e.user, e.record, e.query = pundit_user, record, query
+ e.user, e.record, e.query = policy(record).user, record, query
raise e, "not allowed to #{query} this #{record}"
end
true

0 comments on commit 2752223

Please sign in to comment.