2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
class UserCallout < ApplicationRecord
|
2018-03-17 18:26:18 +05:30
|
|
|
belongs_to :user
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
enum feature_name: {
|
|
|
|
gke_cluster_integration: 1,
|
|
|
|
gcp_signup_offer: 2,
|
|
|
|
cluster_security_warning: 3,
|
2021-04-17 20:07:23 +05:30
|
|
|
ultimate_trial: 4, # EE-only
|
2021-03-11 19:13:27 +05:30
|
|
|
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-11-24 15:15:51 +05:30
|
|
|
suggest_popover_dismissed: 9,
|
|
|
|
tabs_position_highlight: 10,
|
2021-03-11 19:13:27 +05:30
|
|
|
threat_monitoring_info: 11, # EE-only
|
|
|
|
account_recovery_regular_check: 12, # EE-only
|
2021-04-29 21:17:54 +05:30
|
|
|
service_templates_deprecated_callout: 14,
|
2021-03-11 19:13:27 +05:30
|
|
|
web_ide_alert_dismissed: 16, # no longer in use
|
2020-11-24 15:15:51 +05:30
|
|
|
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,
|
2021-01-29 00:20:46 +05:30
|
|
|
feature_flags_new_version: 24,
|
2021-02-22 17:27:13 +05:30
|
|
|
registration_enabled_callout: 25,
|
2021-03-11 19:13:27 +05:30
|
|
|
new_user_signups_cap_reached: 26, # EE-only
|
|
|
|
unfinished_tag_cleanup_callout: 27,
|
2021-04-29 21:17:54 +05:30
|
|
|
eoa_bronze_plan_banner: 28, # EE-only
|
2021-06-08 01:23:25 +05:30
|
|
|
pipeline_needs_banner: 29,
|
|
|
|
pipeline_needs_hover_tip: 30,
|
2021-09-04 01:27:46 +05:30
|
|
|
web_ide_ci_environments_guidance: 31,
|
|
|
|
security_configuration_upgrade_banner: 32
|
2020-11-24 15:15:51 +05:30
|
|
|
}
|
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 }
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
def dismissed_after?(dismissed_after)
|
|
|
|
dismissed_at > dismissed_after
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|