summaryrefslogtreecommitdiff
path: root/app/models/merge_request.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-02-26 19:34:14 -0800
committerDouwe Maan <douwe@selenight.nl>2016-02-26 19:34:14 -0800
commitacf9778e77e5d6e36cb3eb750e88adaa5881a94a (patch)
treeb50ec601a245819389d7c8977de7e6f843789ff7 /app/models/merge_request.rb
parent01160fc06182de89c400af174861f6545ad6ceb8 (diff)
downloadgitlab-ce-acf9778e77e5d6e36cb3eb750e88adaa5881a94a.tar.gz
Use specialized system notes when MR is (un)marked as WIP
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r--app/models/merge_request.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 1543ef311d7..04c378691f3 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -259,8 +259,14 @@ class MergeRequest < ActiveRecord::Base
self.target_project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::CLOSED).last
end
+ WIP_REGEX = /\A\[?WIP(\]|:| )\s*/i.freeze
+
def work_in_progress?
- !!(title =~ /\A\[?WIP(\]|:| )/i)
+ title =~ WIP_REGEX
+ end
+
+ def wipless_title
+ self.title.sub(WIP_REGEX, "")
end
def mergeable?