diff --git a/CHANGELOG.md b/CHANGELOG.md index b16cddbc..d83e138e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## Changed + +- Deprecated `Pundit::SUFFIX`, moved it to `Pundit::PolicyFinder::SUFFIX` (#835) + ## 2.4.0 (2024-08-26) ## Changed diff --git a/lib/pundit.rb b/lib/pundit.rb index a7263b39..4f143086 100644 --- a/lib/pundit.rb +++ b/lib/pundit.rb @@ -19,7 +19,9 @@ class Pundit::Error < StandardError; end # rubocop:disable Style/ClassAndModuleC # @api public module Pundit - SUFFIX = "Policy" + # @api private + # @deprecated See {Pundit::PolicyFinder} + SUFFIX = Pundit::PolicyFinder::SUFFIX # @api private # @private diff --git a/lib/pundit/policy_finder.rb b/lib/pundit/policy_finder.rb index ecc6e9bb..b63e7276 100644 --- a/lib/pundit/policy_finder.rb +++ b/lib/pundit/policy_finder.rb @@ -10,6 +10,9 @@ module Pundit # finder.scope #=> UserPolicy::Scope # class PolicyFinder + # @api private + SUFFIX = "Policy" + attr_reader :object # @param object [any] the object to find policy and scope classes for