diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-20 16:38:54 +0300 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-20 22:44:21 +0300 |
commit | 208b18c956b38103b98bc93a952dc1e8a200dead (patch) | |
tree | 518e0892089d6d3771097192be2487c446343bfa /app/models/user.rb | |
parent | 74f8f260982a9b9e1941ad803d53d229cc27c85f (diff) |
Unify check branch name exist
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 2e458329cb9..876ccc69d8d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -487,9 +487,8 @@ class User < ActiveRecord::Base events.recent.find do |event| project = Project.find_by_id(event.project_id) next unless project - repo = project.repository - if repo.branch_names.include?(event.branch_name) + if project.repository.branch_exists?(event.branch_name) merge_requests = MergeRequest.where("created_at >= ?", event.created_at). where(source_project_id: project.id, source_branch: event.branch_name) |