gitlab-org--gitlab-foss/app/models/label_link.rb
Yorick Peterse 5819ca1a24
Added Cop to blacklist polymorphic associations
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.
2017-06-07 17:36:55 +02:00

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