From dddd6ff61ae5a7af0bc85fffaae0a4e939f92e0a Mon Sep 17 00:00:00 2001 From: Jiazhen Xie Date: Sat, 18 Feb 2017 16:35:34 +0000 Subject: [PATCH] Quote the class name --- lib/pundit.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pundit.rb b/lib/pundit.rb index 1bc0cf1..f85f8eb 100644 --- a/lib/pundit.rb +++ b/lib/pundit.rb @@ -84,7 +84,7 @@ module Pundit policy_scope = PolicyFinder.new(scope).scope policy_scope.new(user, scope).resolve if policy_scope rescue ArgumentError - raise InvalidConstructorError, "Invalid #{policy_scope.class} constructor is called." + raise InvalidConstructorError, "Invalid #<#{policy_scope}> constructor is called" end # Retrieves the policy scope for the given record. @@ -99,7 +99,7 @@ module Pundit policy_scope = PolicyFinder.new(scope).scope! policy_scope.new(user, scope).resolve rescue ArgumentError - raise InvalidConstructorError, "Invalid #{policy_scope.class} constructor is called." + raise InvalidConstructorError, "Invalid #<#{policy_scope}> constructor is called" end # Retrieves the policy for the given record. @@ -113,7 +113,7 @@ module Pundit policy = PolicyFinder.new(record).policy policy.new(user, record) if policy rescue ArgumentError - raise InvalidConstructorError, "Invalid #{policy.class} constructor is called." + raise InvalidConstructorError, "Invalid #<#{policy}> constructor is called" end # Retrieves the policy for the given record. @@ -128,7 +128,7 @@ module Pundit policy = PolicyFinder.new(record).policy! policy.new(user, record) rescue ArgumentError - raise InvalidConstructorError, "Invalid #{policy.class} constructor is called." + raise InvalidConstructorError, "Invalid #<#{policy}> constructor is called" end end