-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
3558 Add validations for partner requests settings #3647
Conversation
8855154
to
98aed5f
Compare
98aed5f
to
11013a3
Compare
11013a3
to
8788946
Compare
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.
Looks good. Thanks for also getting the Ruby Upgrade!
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.
One minor comment, otherwise looks good!
app/models/partners/profile.rb
Outdated
@@ -129,5 +130,9 @@ def client_share_is_0_or_100 | |||
errors.add(:base, "Total client share must be 0 or 100") | |||
end | |||
end | |||
|
|||
def has_at_least_one_request_setting | |||
errors.add(:base, "At least one request type must be set") unless enable_child_based_requests || enable_individual_requests || enable_quantity_based_requests |
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.
I prefer using if !
instead of unless
if there's more than one condition - I can never remember how it reads otherwise.
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.
Updated!
…st version of Ruby.
8788946
to
4df17b4
Compare
Thanks for the contribution! FYI for next time - if there is an active review, please don't force push changes, as it is more difficult to see what changed since the review. |
@dorner Gotcha, thanks :) |
@dacur This went into production on Sunday. Thank you for your contribution! |
Resolves #3558
Description
Adds a validation so that a partner cannot entirely remove their own ability to make requests through the partner profile. Also adds tests for this change, and updated a failing spec that was caused by this change.
Other changes include:
.vscode/
to.gitignore
Type of change
How Has This Been Tested?
Added tests and ran the entire test suite.