user_callout.rb 437 Bytes
Newer Older
1 2
# frozen_string_literal: true

3
class UserCallout < ActiveRecord::Base
Matija Čupić's avatar
Matija Čupić committed
4
  belongs_to :user
5

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

10
  validates :user, presence: true
11 12 13 14
  validates :feature_name,
    presence: true,
    uniqueness: { scope: :user_id },
    inclusion: { in: UserCallout.feature_names.keys }
Matija Čupić's avatar
Matija Čupić committed
15
end