Skip to content

Commit

Permalink
Deprecate Pundit::SUFFIX in favor of Pundit::PolicyFinder::SUFFIX
Browse files Browse the repository at this point in the history
It's only used by the PolicyFinder, so it belongs in there.
  • Loading branch information
Burgestrand committed Oct 11, 2024
1 parent 93a9765 commit bc40b82
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## Changed

- Deprecated `Pundit::SUFFIX`, moved it to `Pundit::PolicyFinder::SUFFIX` (#835)

## 2.4.0 (2024-08-26)

## Changed
Expand Down
4 changes: 3 additions & 1 deletion lib/pundit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions lib/pundit/policy_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc40b82

Please sign in to comment.