2018-07-25 09:30:33 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-02 21:51:03 +00:00
|
|
|
class UserCallout < ActiveRecord::Base
|
2018-01-26 16:06:52 +00:00
|
|
|
belongs_to :user
|
2018-02-02 02:07:33 +00:00
|
|
|
|
2018-02-02 23:16:24 +00:00
|
|
|
enum feature_name: {
|
2018-05-07 18:06:02 +00:00
|
|
|
gke_cluster_integration: 1,
|
2018-09-06 04:13:44 +00:00
|
|
|
gcp_signup_offer: 2,
|
2018-10-12 09:45:50 +00:00
|
|
|
cluster_security_warning: 3
|
2018-02-02 23:16:24 +00:00
|
|
|
}
|
|
|
|
|
2018-02-02 02:07:33 +00:00
|
|
|
validates :user, presence: true
|
2018-02-02 23:16:24 +00:00
|
|
|
validates :feature_name,
|
|
|
|
presence: true,
|
|
|
|
uniqueness: { scope: :user_id },
|
|
|
|
inclusion: { in: UserCallout.feature_names.keys }
|
2018-01-26 16:06:52 +00:00
|
|
|
end
|