summaryrefslogtreecommitdiff
path: root/app/models/user_callout.rb
blob: 76e7bc06b4ecece27ae5f3ca269b1358b99bf3f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class UserCallout < ActiveRecord::Base
  belongs_to :user

  # We use `UserCalloutEnums.feature_names` here so that EE can more easily
  # extend this `Hash` with new values.
  enum feature_name: ::UserCalloutEnums.feature_names

  validates :user, presence: true
  validates :feature_name,
    presence: true,
    uniqueness: { scope: :user_id },
    inclusion: { in: UserCallout.feature_names.keys }
end