From ebbe09049f32eed129770fd5bfb1eff13bee6c98 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 20 Jun 2013 14:07:09 +0600 Subject: [PATCH] small refactoring --- app/models/comment.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/comment.rb b/app/models/comment.rb index 8ad94258e..f78148b86 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -163,10 +163,8 @@ class Comment < ActiveRecord::Base opts = {:created_from_commit_hash => element[0].hex} if item.is_a?(GitHook) # dont create duplicate link to issue next if Comment.find_existing_automatic_comment issue, opts - if item.is_a?(GitHook) # dont create link to outdated commit - next if !item.project.repo.commit(element[0]) - end + next if item.is_a?(GitHook) && !item.project.repo.commit(element[0]) comment = linker.comments.new :body => 'automatic comment' comment.commentable, comment.project, comment.automatic = issue, issue.project, true comment.data = {:from_project_id => item.project.id}