gitlab-org--gitlab-foss/app/models/board.rb

28 lines
469 B
Ruby
Raw Normal View History

2016-07-27 15:32:32 -04:00
class Board < ActiveRecord::Base
belongs_to :project
has_many :lists, -> { order(:list_type, :position) }, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
2016-07-27 15:32:32 -04:00
2017-08-28 17:56:49 -04:00
validates :project, presence: true, if: :project_needed?
def project_needed?
true
end
2017-08-31 15:34:57 -04:00
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
2016-07-27 15:32:32 -04:00
end