2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
class UserCallout < ActiveRecord::Base
|
|
|
|
belongs_to :user
|
|
|
|
|
2018-12-23 12:14:25 +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
|