2018-07-25 05:30:33 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-02 16:51:03 -05:00
|
|
|
class UserCallout < ActiveRecord::Base
|
2018-01-26 11:06:52 -05:00
|
|
|
belongs_to :user
|
2018-02-01 21:07:33 -05:00
|
|
|
|
2018-11-13 11:29:14 -05:00
|
|
|
# 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-02-02 18:16:24 -05:00
|
|
|
|
2018-02-01 21:07:33 -05:00
|
|
|
validates :user, presence: true
|
2018-02-02 18:16:24 -05:00
|
|
|
validates :feature_name,
|
|
|
|
presence: true,
|
|
|
|
uniqueness: { scope: :user_id },
|
|
|
|
inclusion: { in: UserCallout.feature_names.keys }
|
2018-01-26 11:06:52 -05:00
|
|
|
end
|