summaryrefslogtreecommitdiffstats
path: root/app/models/changeset.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-10 18:56:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-10 18:56:59 +0000
commit5f10cc867327cd2d2620f10b30ca9c5f2f3a8791 (patch)
treef842a577ec88d42c5ef72d57d195e3b695e106f9 /app/models/changeset.rb
parent45203143c15d3909e1cd343fc59ee21cc5f52a86 (diff)
downloadredmine-5f10cc867327cd2d2620f10b30ca9c5f2f3a8791.tar.gz
redmine-5f10cc867327cd2d2620f10b30ca9c5f2f3a8791.zip
Added the ability to set the "done ratio" of issues fixed by commit (original path by Nikolay Solakov, slightly edited).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@821 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/changeset.rb')
-rw-r--r--app/models/changeset.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index 330338ab1..21e14fc0d 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -55,8 +55,9 @@ class Changeset < ActiveRecord::Base
ref_keywords = Setting.commit_ref_keywords.downcase.split(",")
# keywords used to fix issues
fix_keywords = Setting.commit_fix_keywords.downcase.split(",")
- # status applied
+ # status and optional done ratio applied
fix_status = IssueStatus.find_by_id(Setting.commit_fix_status_id)
+ done_ratio = Setting.commit_fix_done_ratio.blank? ? nil : Setting.commit_fix_done_ratio.to_i
kw_regexp = (ref_keywords + fix_keywords).collect{|kw| Regexp.escape(kw.strip)}.join("|")
return if kw_regexp.blank?
@@ -75,6 +76,7 @@ class Changeset < ActiveRecord::Base
# don't change the status is the issue is already closed
next if issue.status.is_closed?
issue.status = fix_status
+ issue.done_ratio = done_ratio if done_ratio
issue.save
end
end