Commit 383ac10c authored by Alex Elman's avatar Alex Elman

Issue-280 Send notifications when a note is added to a commit and author is a group member

This fixes a bug where commit authors weren't receiving email notifications for notes added to their commits and their membership was in the group but not the project. The fix is to look up membership via the team object which accounts for both project and group members.
parent f9814bf2
...@@ -251,8 +251,8 @@ class Note < ActiveRecord::Base ...@@ -251,8 +251,8 @@ class Note < ActiveRecord::Base
def commit_author def commit_author
@commit_author ||= @commit_author ||=
project.users.find_by(email: noteable.author_email) || project.team.users.find_by(email: noteable.author_email) ||
project.users.find_by(name: noteable.author_name) project.team.users.find_by(name: noteable.author_name)
rescue rescue
nil nil
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment