From 11b70c97e3a49b6e6235f67452d56612fc141542 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Mon, 31 Oct 2011 23:21:28 +0400 Subject: [PATCH] fix issue notification properly --- app/controllers/issues_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 083fa079..3aefb523 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -41,10 +41,8 @@ class IssuesController < ApplicationController def create @issue = @project.issues.new(params[:issue]) @issue.author = current_user - if @issue.save - @project.users.reject { |u| u.id == current_user.id } .each do |u| - Notify.new_issue_email(@issue).deliver - end + if @issue.save && @issue.assignee != current_user + Notify.new_issue_email(@issue).deliver end respond_with(@issue)