2018-07-25 05:30:33 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-28 09:17:42 -04:00
|
|
|
class LabelPriority < ApplicationRecord
|
2020-12-16 10:10:18 -05:00
|
|
|
include Importable
|
|
|
|
|
2016-10-14 15:12:07 -04:00
|
|
|
belongs_to :project
|
|
|
|
belongs_to :label
|
|
|
|
|
2020-12-16 10:10:18 -05:00
|
|
|
validates :label, presence: true, unless: :importing?
|
|
|
|
validates :project, :priority, presence: true
|
2016-10-14 15:12:07 -04:00
|
|
|
validates :label_id, uniqueness: { scope: :project_id }
|
|
|
|
validates :priority, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
|
|
|
|
end
|