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
fixed sending survey bugs - #151328240 #1135
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kayla-glick
suggested changes
Sep 25, 2017
@@ -84,7 +84,7 @@ def show | |||
|
|||
def update | |||
if @sub_service_request.update_attributes(sub_service_request_params) | |||
@sub_service_request.distribute_surveys if @sub_service_request.is_complete? | |||
@sub_service_request.distribute_surveys if (@sub_service_request.status == 'complete' && sub_service_request_params[:status].present?) |
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 think instead of checking that the status is only 'complete', this should probably check if the status is in FINISHED_STATUSES
if (FINISHED_STATUSES.include?(@sub_service_request.status) && sub_service_request_params[:status].present?)
It was sending survey notification if the status is in finished_statuses, however, that was causing some issues, see details in https://www.pivotaltracker.com/n/projects/1918597/stories/151310907.
So Wenjun asked to change it to only send survey with ‘complete” status:
https://www.pivotaltracker.com/n/projects/1918597/stories/151328240
From: kyle-glick [mailto:notifications@github.com]
Sent: Monday, September 25, 2017 9:22 AM
To: sparc-request/sparc-request <sparc-request@noreply.github.com>
Cc: Ying Wu <Ying.Wu@pbrc.edu>; Author <author@noreply.github.com>
Subject: Re: [sparc-request/sparc-request] fixed sending survey bugs - #151328240 (#1135)
@kyle-glick requested changes on this pull request.
________________________________
In app/controllers/dashboard/sub_service_requests_controller.rb<#1135 (comment)>:
@@ -84,7 +84,7 @@ def show
def update
if @sub_service_request.update_attributes(sub_service_request_params)
- @sub_service_request.distribute_surveys if @sub_service_request.is_complete?
+ @sub_service_request.distribute_surveys if (@sub_service_request.status == 'complete' && sub_service_request_params[:status].present?)
I think instead of checking that the status is only 'complete', this should probably check if the status is in FINISHED_STATUSES
if (FINISHED_STATUSES.include?(@sub_service_request.status) && sub_service_request_params[:status].present?)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1135 (review)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AHS1u0oOgiuybeRPjRFw1xYNFCVF5IjLks5sl7ckgaJpZM4PhDe2>.
|
kayla-glick
approved these changes
Sep 26, 2017
jleonardw9
approved these changes
Sep 28, 2017
marklohr
approved these changes
Sep 28, 2017
jwiel86
approved these changes
Oct 2, 2017
Stuart-Johnson
approved these changes
Oct 4, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://www.pivotaltracker.com/n/projects/1918597/stories/151328240