summaryrefslogtreecommitdiff
path: root/app/models/label_link.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-07-22 12:10:45 +0200
committerJames Lopez <james@jameslopez.es>2016-08-01 09:57:40 +0200
commitaad0ae71620d8e988faf75587a612b933df00366 (patch)
treeea7c49eb635513c65c901fb42b0d45b4c5919846 /app/models/label_link.rb
parent2f344eca42f1f0fa8ac122316687bc166c489bf1 (diff)
downloadgitlab-ce-aad0ae71620d8e988faf75587a612b933df00366.tar.gz
squashed - fixed label and milestone association problems, updated specs and refactored reader class a bitfix/labels-milestones-import
Diffstat (limited to 'app/models/label_link.rb')
-rw-r--r--app/models/label_link.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/label_link.rb b/app/models/label_link.rb
index 47bd6eaf35f..51b5c2b1f4c 100644
--- a/app/models/label_link.rb
+++ b/app/models/label_link.rb
@@ -1,7 +1,9 @@
class LabelLink < ActiveRecord::Base
+ include Importable
+
belongs_to :target, polymorphic: true
belongs_to :label
- validates :target, presence: true
- validates :label, presence: true
+ validates :target, presence: true, unless: :importing?
+ validates :label, presence: true, unless: :importing?
end