summaryrefslogtreecommitdiff
path: root/app/models/experiment_user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/experiment_user.rb')
-rw-r--r--app/models/experiment_user.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/experiment_user.rb b/app/models/experiment_user.rb
index 1571b0c3439..e447becc1bd 100644
--- a/app/models/experiment_user.rb
+++ b/app/models/experiment_user.rb
@@ -1,10 +1,14 @@
# frozen_string_literal: true
class ExperimentUser < ApplicationRecord
+ include ::Gitlab::Experimentation::GroupTypes
+
belongs_to :experiment
belongs_to :user
- enum group_type: { control: 0, experimental: 1 }
+ enum group_type: { GROUP_CONTROL => 0, GROUP_EXPERIMENTAL => 1 }
+ validates :experiment_id, presence: true
+ validates :user_id, presence: true
validates :group_type, presence: true
end