-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fixes #1198 - Send mail to question's author on new answer create and test this #1321
Conversation
Generated by 🚫 Danger |
I am new to open source contributions. I did make a new feature branch and then merged it with master. Should I re-submit the request? |
@@ -26,17 +26,17 @@ def likers | |||
|
|||
def answer_notify(current_user) | |||
# notify question author | |||
if current_user.uid != self.author.uid | |||
AnswerMailer.notify_question_author(self.author, self).deliver | |||
if current_user.uid != self.node.author.uid |
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.
Here I'm not sure this is correct, @ananyo2012, can you take a look? I think we do want to notify original node (question) author when an answer is posted, but not the current user (that is, the author of the answer)
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.
Earlier, the if conditional current_user.uid != self.author.uid
was always false since the current_user was always the the answer's author. I have changed that to the node's author.
I think we do want to notify original node (question) author when an answer is posted
Agreed. Line 30 sends the mail to the node's author.
Thank you very much for reviewing.
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.
Yes this look good to me
No need to resubmit - you should be able to add more commits to this same
branch and they'll show up in the PR. Thanks!
…On Mar 8, 2017 10:44 AM, "Saurabh Sikchi" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In app/models/answer.rb
<#1321 (comment)>:
> @@ -26,17 +26,17 @@ def likers
def answer_notify(current_user)
# notify question author
- if current_user.uid != self.author.uid
- AnswerMailer.notify_question_author(self.author, self).deliver
+ if current_user.uid != self.node.author.uid
Earlier, the if conditional current_user.uid != self.author.uid was
always false since the current_user was always the the answer's author. I
have changed that to the node's author.
I think we do want to notify original node (question) author when an
answer is posted
Agreed. Line 30 sends the mail to the node's author.
Thank you very much for reviewing.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1321 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABfJxSOd84uanFj7OLmcLugnYfdMCw8ks5rjtrsgaJpZM4MVCWm>
.
|
@khamba You didn't need to merge the feature branch with the master. Just make the PR with the feature branch. Also whenever you solve an issue it is better to include the issue no like |
Merged, thank you! Please consider picking another issue from our help wanted listings! Thanks!!!!! |
Original Issue #1198
I have made changes to
answer
model'sanswer_notify
method. Earlier, the mail was not being sent to the question's author. After this commit, the mail is being sent and the tests are passing.Also see, pull #1237 (not by me) which implements the proposed solution but the tests fail.
Thank you.
rake test:all