diff --git a/Gemfile b/Gemfile index 9e0cfaf..ebb416b 100644 --- a/Gemfile +++ b/Gemfile @@ -11,4 +11,4 @@ gem "simplecov" gem "yard" gem "standard" gem "actionpack", ">= 3.0.0" -gem "reissue" \ No newline at end of file +gem "reissue" diff --git a/Rakefile b/Rakefile index d749eb3..76f7b62 100644 --- a/Rakefile +++ b/Rakefile @@ -11,4 +11,4 @@ require "reissue/gem" Reissue::Task.create do |task| task.version_file = "lib/pundit/plus/version.rb" -end \ No newline at end of file +end diff --git a/spec/pundit/custom_exception_spec.rb b/spec/pundit/custom_exception_spec.rb index 5c5d06c..31528f7 100644 --- a/spec/pundit/custom_exception_spec.rb +++ b/spec/pundit/custom_exception_spec.rb @@ -13,8 +13,9 @@ class UserPolicy class CustomError < Pundit::NotAuthorizedError def initialize(options = {}) - options[:message] ||= "Custom exception from policy" - super(options) + options_with_message = options.dup + options_with_message[:message] ||= "Custom exception from policy" + super(options_with_message) end end