-
Notifications
You must be signed in to change notification settings - Fork 71
[DX] Remove ? from private policies #12073
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
base: main
Are you sure you want to change the base?
Conversation
|
tbh i think i preferred what we had before ¯\_(ツ)_/¯ |
we should standardize whatever we choose to go with; this syntax was used in some files already but not all of them |
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.
Pull Request Overview
This PR removes question marks (?) from private policy method names to follow Ruby naming conventions. In Ruby, the ? suffix is conventionally used for predicate methods that return boolean values, but for private helper methods in policy classes, it's more conventional to omit the ? suffix.
- Renamed all private helper methods in policy classes from
method_name?tomethod_name - Updated all calls to these private methods to use the new names without
? - Removed some unused private methods (e.g.,
user_in_event?,admin_or_reader?)
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app/policies/wise_transfer_policy.rb | Removed ? from private methods admin_or_user and user_who_can_transfer |
| app/policies/wire_policy.rb | Removed ? from private methods admin_or_user and user_who_can_transfer |
| app/policies/stripe_card_policy.rb | Removed ? from private methods including member_and_cardholder, admin_or_manager, cardholder, member, and grantee |
| app/policies/sponsor_policy.rb | Removed ? from private methods auditor_or_reader and admin_or_member |
| app/policies/receiptable_policy.rb | Removed ? from private method present_in_events |
| app/policies/receipt_policy.rb | Removed ? from private method unlocked |
| app/policies/paypal_transfer_policy.rb | Removed ? from private method user_who_can_transfer |
| app/policies/organizer_position_policy.rb | Removed ? from private methods admin_or_manager and admin_or_contract_signee |
| app/policies/organizer_position_invite_policy.rb | Removed ? from private method admin_or_manager |
| app/policies/organizer_position_invite/request_policy.rb | Removed ? from private methods admin, manager, and admin_or_manager |
| app/policies/organizer_position_invite/link_policy.rb | Removed ? from private methods admin, manager, and admin_or_manager |
| app/policies/organizer_position_deletion_request_policy.rb | Removed ? from private methods current_user_is_manager and current_user_is_the_user; removed unused user_in_event? method |
| app/policies/organizer_position/spending/control_policy.rb | Removed ? from private methods current_user_manager and own_control |
| app/policies/invoice_policy.rb | Removed ? from private method unapproved |
| app/policies/increase_check_policy.rb | Removed ? from private methods admin_or_user and user_who_can_transfer |
| app/policies/hcb_code_policy.rb | Removed ? from private methods present_in_events and gte_member_in_events |
| app/policies/hcb_code/tag/suggestion_policy.rb | Removed ? from private method admin_or_user |
| app/policies/g_suite_alias_policy.rb | Removed ? from private method admin_or_manager |
| app/policies/g_suite_account_policy.rb | Removed ? from private method admin_or_manager |
| app/policies/event_policy.rb | Removed ? from private methods including admin, auditor, reader, member, manager, admin_or_member, auditor_or_reader, auditor_or_member, admin_or_manager, and is_not_demo_mode; removed unused admin_or_reader? method |
| app/policies/event/scoped_tag_policy.rb | Removed ? from private method admin_or_manager |
| app/policies/disbursement_policy.rb | Removed ? from private method auditor_or_user |
| app/policies/column/account_number_policy.rb | Removed ? from private method admin_or_manager |
| app/policies/check_deposit_policy.rb | Removed ? from private methods; renamed user? to member and auditor_or_user? to auditor_or_member for clarity; removed unused user_who_can_transfer? method |
| app/policies/card_grant_policy.rb | Removed ? from private methods user_in_event and authorized_to_activate |
| app/policies/card_grant/pre_authorization_policy.rb | Removed ? from private methods user_in_event and manager_in_event |
| app/policies/announcement_policy.rb | Removed ? from private methods admin, manager, reader, admin_or_manager, and auditor_or_reader |
| app/policies/announcement/block_policy.rb | Removed ? from private methods admin, manager, and admin_or_manager |
| app/policies/ach_transfer_policy.rb | Removed ? from private methods user_who_can_transfer, admin_or_user, admin_or_manager, and is_public |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary of the problem
We weren't following typical policy convention.
Describe your changes