diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-07-26 07:37:22 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-26 07:37:22 +0300 |
commit | bbab5d014f10914b1e5d7a73dc0e85ea57344979 (patch) | |
tree | 884dcc73862c6d840f84eaacda0db2a1ecff99dc /app/models/discussion.rb | |
parent | c9aee48ced1bf9b4bec758be80791b6cbaccd335 (diff) |
Add methods to resolve diff notes and discussions
Diffstat (limited to 'app/models/discussion.rb')
-rw-r--r-- | app/models/discussion.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/discussion.rb b/app/models/discussion.rb index ff85e2038a7..64116d225ae 100644 --- a/app/models/discussion.rb +++ b/app/models/discussion.rb @@ -63,6 +63,18 @@ class Discussion notes.any?(&:to_be_resolved?) end + def resolve!(current_user) + notes.each do |note| + note.resolve!(current_user) if note.resolvable? + end + end + + def unresolve! + notes.each do |note| + note.unresolve! if note.resolvable? + end + end + def for_target?(target) self.noteable == target && !diff_discussion? end |