2014-07-29 14:10:15 +00:00
|
|
|
class Label < ActiveRecord::Base
|
|
|
|
belongs_to :project
|
|
|
|
has_many :label_links, dependent: :destroy
|
|
|
|
|
|
|
|
validates :color, format: { with: /\A\#[0-9A-Fa-f]{3}{1,2}+\Z/ }, allow_blank: true
|
|
|
|
validates :project, presence: true
|
2014-07-29 16:19:26 +00:00
|
|
|
validates :title, presence: true
|
|
|
|
|
|
|
|
def name
|
|
|
|
title
|
|
|
|
end
|
2014-07-29 14:10:15 +00:00
|
|
|
end
|