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

16 lines
297 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
2016-07-27 15:32:32 -04:00
validates :project, presence: true
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