debian-mirror-gitlab/app/models/experiment_user.rb

15 lines
358 B
Ruby
Raw Normal View History

2020-10-24 23:57:45 +05:30
# frozen_string_literal: true
class ExperimentUser < ApplicationRecord
2021-01-29 00:20:46 +05:30
include ::Gitlab::Experimentation::GroupTypes
2020-10-24 23:57:45 +05:30
belongs_to :experiment
belongs_to :user
2021-01-29 00:20:46 +05:30
enum group_type: { GROUP_CONTROL => 0, GROUP_EXPERIMENTAL => 1 }
2020-10-24 23:57:45 +05:30
2021-01-29 00:20:46 +05:30
validates :experiment_id, presence: true
validates :user_id, presence: true
2020-10-24 23:57:45 +05:30
validates :group_type, presence: true
end