Skip to content

Commit 9e4e336

Browse files
committed
fix/Do not notify snippet creator when then comment on their own snippet
1 parent 5083744 commit 9e4e336

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/controllers/comments_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ def create
77
@comment = @snippet.comments.new(comment_params)
88

99
if @comment.save
10-
@comment.notifications.create(user: @snippet.user)
10+
11+
unless @snippet.user == @comment.user
12+
@comment.notifications.create(user: @snippet.user)
13+
end
14+
1115
flash[:notice] = 'Comment created!'
1216
redirect_to snippet_path(@snippet)
1317
else

0 commit comments

Comments
 (0)