debian-mirror-gitlab/app/models/users/group_callout.rb

31 lines
871 B
Ruby
Raw Normal View History

2021-11-11 11:23:49 +05:30
# frozen_string_literal: true
module Users
class GroupCallout < ApplicationRecord
2022-01-26 12:08:38 +05:30
include Users::Calloutable
2021-11-11 11:23:49 +05:30
self.table_name = 'user_group_callouts'
belongs_to :group
enum feature_name: {
2022-04-04 11:22:00 +05:30
invite_members_banner: 1,
approaching_seat_count_threshold: 2, # EE-only
storage_enforcement_banner_first_enforcement_threshold: 43,
storage_enforcement_banner_second_enforcement_threshold: 44,
storage_enforcement_banner_third_enforcement_threshold: 45,
storage_enforcement_banner_fourth_enforcement_threshold: 46
2021-11-11 11:23:49 +05:30
}
validates :group, presence: true
validates :feature_name,
presence: true,
uniqueness: { scope: [:user_id, :group_id] },
inclusion: { in: GroupCallout.feature_names.keys }
def source_feature_name
"#{feature_name}_#{group_id}"
end
end
end