diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-02-26 19:34:14 -0800 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-02-26 19:34:14 -0800 |
commit | acf9778e77e5d6e36cb3eb750e88adaa5881a94a (patch) | |
tree | b50ec601a245819389d7c8977de7e6f843789ff7 /app/models/merge_request.rb | |
parent | 01160fc06182de89c400af174861f6545ad6ceb8 (diff) | |
download | gitlab-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.rb | 8 |
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? |