summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-01-16 17:55:41 +0000
committerRémy Coutable <remy@rymai.me>2018-01-16 17:55:41 +0000
commit9d45c491c36d9e19c929902f02c79b3ac2536869 (patch)
tree5a2b07077295d1a41b5881008a41294ceb35ae1b /app
parentac23f3f0d1b36af6208a84cfc4d2683cd7d0b65d (diff)
parent38e9e934f49115021614b66353bbac459b6b70bb (diff)
downloadgitlab-ce-9d45c491c36d9e19c929902f02c79b3ac2536869.tar.gz
Merge branch '40818-last-push-widget-does-not-appear-after-pushing-new-commit' into 'master'
Last push widget will show banner for new pushes to previously merged branch Closes #40818 See merge request gitlab-org/gitlab-ce!15728
Diffstat (limited to 'app')
-rw-r--r--app/models/push_event.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/push_event.rb b/app/models/push_event.rb
index 83ce9014094..90c085c888e 100644
--- a/app/models/push_event.rb
+++ b/app/models/push_event.rb
@@ -46,10 +46,11 @@ class PushEvent < Event
# Returns PushEvent instances for which no merge requests have been created.
def self.without_existing_merge_requests
- existing_mrs = MergeRequest.except(:order)
+ existing_mrs = MergeRequest.except(:order, :where)
.select(1)
.where('merge_requests.source_project_id = events.project_id')
.where('merge_requests.source_branch = push_event_payloads.ref')
+ .where(state: :opened)
# For reasons unknown the use of #eager_load will result in the
# "push_event_payload" association not being set. Because of this we're