8fbbf41e29
This is allowed for existing instances so we don't end up 76 offenses right away, but for new code one should _only_ use this if they _have_ to remove non database data. Even then it's usually better to do this in a service class as this gives you more control over how to remove the data (e.g. in bulk).
15 lines
341 B
Ruby
15 lines
341 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
|
|
|
|
def backlog_list
|
|
lists.merge(List.backlog).take
|
|
end
|
|
|
|
def closed_list
|
|
lists.merge(List.closed).take
|
|
end
|
|
end
|