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
Replace ban/banned with suspend/suspended in user facing text #5816
Replace ban/banned with suspend/suspended in user facing text #5816
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: approved despite failing check because it's a simple wording change from "banned" to "suspended" to make it work.
The PR description mentions "at least in user facing strings", so I think this is ok. 👍
Overall though I'm a fan of having a ubiquitous language, which would include renaming the methods at one point. The more words we have for the same thing ("ban", "banish", "suspend"), the harder it will become to onboard new people.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good @rhymes, thanks. Just left some questions.
@@ -46,7 +46,7 @@ def after_sign_in_path_for(resource) | |||
end | |||
|
|||
def raise_banned | |||
raise "BANNED" if current_user&.banned | |||
raise "SUSPENDED" if current_user&.banned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General question: the way this is used is through before_action
s like this one:
before_action :raise_banned, only: %i[new create update]
Could it potentially make sense to move this check into a policy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also on the danger of sounding nitpicky, it's a bit confusing to see a method called raise_banned
and then raise "SUSPENDED" right below. Maybe we can rename the method to
raise_suspended`? It only would need to change in 3 places from what I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it potentially make sense to move this check into a policy?
Not sure TBH as I'm totally unfamiliar with all the suspension tooling, but I think it's out of the scope here
Also on the danger of sounding nitpicky, it's a bit confusing to see a method called raise_banned and then raise "SUSPENDED" right below. Maybe we can rename the method to raise_suspended`? It only would need to change in 3 places from what I can tell.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that a policy would be outside the scope of this PR, but it seemed like a good point to start the discussion. 😃
Thanks for changing the method name!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How painful would it be to rename the role on the user as well? Just looking at this method, we have current_user&.banned
, which might cause a bit of confusion since "banned" is actually now "suspended". I don't think this should block this PR, but we probably shouldn't have too many different ways to refer to the same concept.
Also, looking at role.rb
, we also have a comment_banned
role. Do we need to make any modifications to handle that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the goal is to slowly change it all I think. We'd probably need a migration to go over the roles
table and update that role.
Let's see what we can do in a follow up PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds great. Definitely seems like it could be its own PR 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update our honeybadger error handling to ensure these errors are grouped appropriately
@mstruve please take over this PR as I'm not entirely sure what I should put in the initializer 👀
something else? |
Either works but if we don't want a new error to pop up in Honeybadger then lets go with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
What type of PR is this? (check all applicable)
Description
We're going to change the language, at least in user facing strings, from ban/banned/banished to suspend/suspended.