BigW Consortium Gitlab

board.rb 469 Bytes
Newer Older
1 2 3
class Board < ActiveRecord::Base
  belongs_to :project

4
  has_many :lists, -> { order(:list_type, :position) }, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
5

6 7 8 9 10
  validates :project, presence: true, if: :project_needed?

  def project_needed?
    true
  end
11

Felipe Artur committed
12 13 14 15 16 17 18 19
  def parent
    project
  end

  def group_board?
    false
  end

20 21 22 23
  def backlog_list
    lists.merge(List.backlog).take
  end

24 25
  def closed_list
    lists.merge(List.closed).take
26
  end
27
end