summaryrefslogtreecommitdiff
path: root/app/models/board.rb
blob: c56422914a944d05c4b0e568cfaff7fcbdb97865 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Board < ActiveRecord::Base
  belongs_to :project

  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