Dont show last push widget if user removed this branch

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2013-11-13 14:17:03 +02:00
parent 201d489780
commit 467e4e81f4
No known key found for this signature in database
GPG Key ID: 2CEAFD2671262EC2
1 changed files with 3 additions and 0 deletions

View File

@ -126,6 +126,9 @@ module ApplicationHelper
# Skip if user already created appropriate MR
return false if project.merge_requests.where(source_branch: event.branch_name).opened.any?
# Skip if user removed branch right after that
return false unless project.repository.branch_names.include?(event.branch_name)
true
end