gitlab-org--gitlab-foss/app/models/board.rb
2017-08-31 16:34:57 -03:00

27 lines
469 B
Ruby

class Board < ActiveRecord::Base
belongs_to :project
has_many :lists, -> { order(:list_type, :position) }, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
validates :project, presence: true, if: :project_needed?
def project_needed?
true
end
def parent
project
end
def group_board?
false
end
def backlog_list
lists.merge(List.backlog).take
end
def closed_list
lists.merge(List.closed).take
end
end