From ace3dcb96e1ff90cfda6bc0ec949ecb20ca7b0a9 Mon Sep 17 00:00:00 2001 From: Jim Gay Date: Wed, 23 Oct 2024 13:46:49 -0400 Subject: [PATCH] Update formatting --- Gemfile | 2 +- Rakefile | 2 +- spec/pundit/custom_exception_spec.rb | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) 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