1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00

Extract magic string "Policy" into a constant.

See #233
This commit is contained in:
Jonas Nicklas 2015-04-01 11:17:30 +02:00
parent 1bfe952d09
commit 72fe4923c4
2 changed files with 3 additions and 1 deletions

View file

@ -7,6 +7,8 @@ require "active_support/core_ext/module/introspection"
require "active_support/dependencies/autoload"
module Pundit
SUFFIX = "Policy"
class NotAuthorizedError < StandardError
attr_reader :query, :record, :policy

View file

@ -53,7 +53,7 @@ module Pundit
else
object.class
end
"#{klass}Policy"
"#{klass}#{SUFFIX}"
end
end
end