summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-09-27 09:27:21 +0000
committerRobert Speicher <robert@gitlab.com>2016-09-27 09:27:21 +0000
commit83624a0ced2e66d1b71103b3ba4f1e4841e6a3d0 (patch)
tree12a2973586509fcea0a9490551771e2bec12c88a /app
parentab496d82ecd1cc675d10fc30a3af279ad4ab1edf (diff)
parent97551e8dd9dc5711951e865e7f9875f8cd5712ac (diff)
downloadgitlab-ce-83624a0ced2e66d1b71103b3ba4f1e4841e6a3d0.tar.gz
Merge branch 'improvement/project-with-board-factory' into 'master'
Improve project_with_board factory to create the default lists ## What does this MR do? Create the default lists after creating a project with the `project_with_board` factory. This makes the setup phase on tests be more simpler. ## Why was this MR needed? These two lists are present in every issue board, so we don't have to create them manually in every test. See merge request !6480
Diffstat (limited to 'app')
-rw-r--r--app/models/board.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/board.rb b/app/models/board.rb
index 3240c4bede3..c56422914a9 100644
--- a/app/models/board.rb
+++ b/app/models/board.rb
@@ -4,4 +4,12 @@ class Board < ActiveRecord::Base
has_many :lists, -> { order(:list_type, :position) }, dependent: :delete_all
validates :project, presence: true
+
+ def backlog_list
+ lists.merge(List.backlog).take
+ end
+
+ def done_list
+ lists.merge(List.done).take
+ end
end