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

16 lines
436 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2019-07-07 11:18:12 +05:30
class UserCallout < ApplicationRecord
2018-03-17 18:26:18 +05:30
belongs_to :user
2019-02-15 15:39:39 +05:30
# We use `UserCalloutEnums.feature_names` here so that EE can more easily
# extend this `Hash` with new values.
enum feature_name: ::UserCalloutEnums.feature_names
2018-03-17 18:26:18 +05:30
validates :user, presence: true
validates :feature_name,
presence: true,
uniqueness: { scope: :user_id },
inclusion: { in: UserCallout.feature_names.keys }
end