summaryrefslogtreecommitdiffstats
path: root/app/models/merge_request.rb
diff options
context:
space:
mode:
authorMarius Mathiesen <marius.mathiesen@gmail.com>2009-06-12 10:21:14 +0200
committerMarius Mathiesen <marius.mathiesen@gmail.com>2009-06-24 12:20:33 +0200
commitd4a271ef7971d79ff3a1d6b4380c028915db2bd6 (patch)
treea4f5995cc51b1bcd91f8d105508457b038c3f6ba /app/models/merge_request.rb
parent84efb5b6e280634f04492cd85b88f385f6bda79d (diff)
downloadgitorious-mainline-outdated-d4a271ef7971d79ff3a1d6b4380c028915db2bd6.zip
gitorious-mainline-outdated-d4a271ef7971d79ff3a1d6b4380c028915db2bd6.tar.gz
gitorious-mainline-outdated-d4a271ef7971d79ff3a1d6b4380c028915db2bd6.tar.bz2
Adding a loose state (status_tag) to merge requests, adding state change to comments.
- Adding a comment to a merge request now potentially sets or changes the loose state of the merge request (target) This way, target repository owners can mark that a merge request should change state when adding comments. This will eventually replace the more final reason from merge requests, replacing it with comments with an added context
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r--app/models/merge_request.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 6dd5f29..a56a91f 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -387,6 +387,17 @@ class MergeRequest < ActiveRecord::Base
save
end
+ def update_status(options)
+ user = options[:user]
+ comment = comments.build(:body => options[:comment], :user => user)
+ if resolvable_by?(user) && new_tag = options[:tag]
+ comment.state_change = [status_tag, new_tag]
+ self.status_tag = new_tag
+ end
+ comment.save
+ save
+ end
+
def valid_oauth_credentials?
response = access_token.get("/")
return Net::HTTPSuccess === response