2016-07-27 15:32:32 -04:00
|
|
|
class Board < ActiveRecord::Base
|
|
|
|
belongs_to :project
|
|
|
|
|
2016-07-31 19:48:00 -04:00
|
|
|
has_many :lists, -> { order(:list_type, :position) }, dependent: :delete_all
|
2016-07-27 15:32:32 -04:00
|
|
|
|
|
|
|
validates :project, presence: true
|
2016-09-26 13:39:41 -04:00
|
|
|
|
2017-03-24 08:40:35 -04:00
|
|
|
def closed_list
|
|
|
|
lists.merge(List.closed).take
|
2016-09-26 13:39:41 -04:00
|
|
|
end
|
2016-07-27 15:32:32 -04:00
|
|
|
end
|