5819ca1a24
One should really use a separate table instead of using polymorphic associations. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11168 for more information.
9 lines
283 B
Ruby
9 lines
283 B
Ruby
class LabelLink < ActiveRecord::Base
|
|
include Importable
|
|
|
|
belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
|
|
belongs_to :label
|
|
|
|
validates :target, presence: true, unless: :importing?
|
|
validates :label, presence: true, unless: :importing?
|
|
end
|