Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-03 18:45:44 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 18:58:58 +0300
commitc08a14c3c20de35018a36f89dec0b10c99a4fd86 (patch)
tree1fabc001dc0ba350ac07809130fd5af668432c0f /app/services/boards
parent9e5a305f18377c9fbe74e44dcef7606ab109291c (diff)
Removes all list-labels when moving to Backlog/Done
Diffstat (limited to 'app/services/boards')
-rw-r--r--app/services/boards/issues/move_service.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/app/services/boards/issues/move_service.rb b/app/services/boards/issues/move_service.rb
index 657268e67b3..398a02ebbfd 100644
--- a/app/services/boards/issues/move_service.rb
+++ b/app/services/boards/issues/move_service.rb
@@ -45,10 +45,25 @@ module Boards
def issue_params
{
- add_label_ids: [moving_to.label_id].compact,
- remove_label_ids: [moving_from.label_id].compact
+ add_label_ids: add_label_ids,
+ remove_label_ids: remove_label_ids
}
end
+
+ def add_label_ids
+ [moving_to.label_id].compact
+ end
+
+ def remove_label_ids
+ label_ids =
+ if moving_to.label?
+ moving_from.label_id
+ else
+ board.lists.label.pluck(:label_id)
+ end
+
+ Array(label_ids).compact
+ end
end
end
end