2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-05-18 00:54:41 +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
|