diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-01 21:43:51 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-10 10:32:25 -0200 |
commit | 1353cff5fed083fd7192dddff5062ac383b1f8a0 (patch) | |
tree | 290a06a1d034ea855e6fa398560a5ce250476eba /app/models/merge_request.rb | |
parent | 10aa99a30c311c59358d1547ebcbe0f6a92227a7 (diff) | |
download | gitlab-ce-1353cff5fed083fd7192dddff5062ac383b1f8a0.tar.gz |
Replaces "Create merge request" link with one to the MR when one exists
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index ddc476447ca..345b9a26d4e 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -137,6 +137,7 @@ class MergeRequest < ActiveRecord::Base scope :by_milestone, ->(milestone) { where(milestone_id: milestone) } scope :in_projects, ->(project_ids) { where("source_project_id in (:project_ids) OR target_project_id in (:project_ids)", project_ids: project_ids) } scope :of_projects, ->(ids) { where(target_project_id: ids) } + scope :opened, -> { with_state(:opened) } scope :merged, -> { with_state(:merged) } scope :closed, -> { with_state(:closed) } scope :closed_and_merged, -> { with_states(:closed, :merged) } |