Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Merge pull request #625 from holyketzer/custom-messages" #684

Merged
merged 1 commit into from
Aug 11, 2021

Conversation

Burgestrand
Copy link
Member

Reverting this because it's blocking us from making a new release, see: #656 (comment)

Additionally, me and @dgmstuart have backtracked a bit and believe that in case you'd like to use a solution similar to this then you should probably use specialized error classes instead, something similar to this:

UserProjectLimitReachedError = Class.new(Pundit::NotAuthorizedError)

def create?
  raise UserProjectLimitReachedError unless user.has_paid_subscription?
end

All that said, I believe that the reasoning in #654 is sound, and so query methods should strive towards returning truthy/falsy as opposed to raising errors to deal with custom error messages.

This reverts commit 6be4621, reversing
changes made to 872ed68.

Reverting this because it's blocking us from making a new release, see:
#656 (comment)
@Burgestrand Burgestrand merged commit 2823669 into master Aug 11, 2021
@Burgestrand Burgestrand deleted the kbs/revert-error-reason branch August 11, 2021 07:06
Copy link
Collaborator

@dgmstuart dgmstuart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants