2018-07-25 05:30:33 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-28 09:17:42 -04:00
|
|
|
class UserCallout < ApplicationRecord
|
2018-01-26 11:06:52 -05:00
|
|
|
belongs_to :user
|
2018-02-01 21:07:33 -05:00
|
|
|
|
2020-09-16 20:09:34 -04:00
|
|
|
enum feature_name: {
|
|
|
|
gke_cluster_integration: 1,
|
|
|
|
gcp_signup_offer: 2,
|
|
|
|
cluster_security_warning: 3,
|
2021-02-24 13:11:28 -05:00
|
|
|
ultimate_trial: 4, # EE-only
|
2021-02-01 16:09:15 -05:00
|
|
|
geo_enable_hashed_storage: 5, # EE-only
|
|
|
|
geo_migrate_hashed_storage: 6, # EE-only
|
|
|
|
canary_deployment: 7, # EE-only
|
|
|
|
gold_trial_billings: 8, # EE-only
|
2020-09-16 20:09:34 -04:00
|
|
|
suggest_popover_dismissed: 9,
|
|
|
|
tabs_position_highlight: 10,
|
2021-02-01 16:09:15 -05:00
|
|
|
threat_monitoring_info: 11, # EE-only
|
|
|
|
account_recovery_regular_check: 12, # EE-only
|
2020-09-16 20:09:34 -04:00
|
|
|
webhooks_moved: 13,
|
|
|
|
service_templates_deprecated: 14,
|
|
|
|
admin_integrations_moved: 15,
|
2021-02-01 16:09:15 -05:00
|
|
|
web_ide_alert_dismissed: 16, # no longer in use
|
2020-09-16 20:09:34 -04:00
|
|
|
active_user_count_threshold: 18, # EE-only
|
|
|
|
buy_pipeline_minutes_notification_dot: 19, # EE-only
|
|
|
|
personal_access_token_expiry: 21, # EE-only
|
|
|
|
suggest_pipeline: 22,
|
|
|
|
customize_homepage: 23,
|
2020-11-16 04:09:18 -05:00
|
|
|
feature_flags_new_version: 24,
|
2020-11-19 10:09:13 -05:00
|
|
|
registration_enabled_callout: 25,
|
2021-02-01 16:09:15 -05:00
|
|
|
new_user_signups_cap_reached: 26, # EE-only
|
|
|
|
unfinished_tag_cleanup_callout: 27,
|
|
|
|
eoa_bronze_plan_banner: 28 # EE-only
|
2020-09-16 20:09:34 -04:00
|
|
|
}
|
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 }
|
2020-02-06 13:08:54 -05:00
|
|
|
|
|
|
|
scope :with_feature_name, -> (feature_name) { where(feature_name: UserCallout.feature_names[feature_name]) }
|
|
|
|
scope :with_dismissed_after, -> (dismissed_after) { where('dismissed_at > ?', dismissed_after) }
|
2018-01-26 11:06:52 -05:00
|
|
|
end
|