chore: Allow super admin to suspend an account (#5174)

This commit is contained in:
Pranav Raj S
2022-08-03 11:40:03 +05:30
committed by GitHub
parent 4152883f38
commit e0cebfaa1a
20 changed files with 259 additions and 23 deletions

View File

@@ -11,10 +11,15 @@
# locale :integer default("en")
# name :string not null
# settings_flags :integer default(0), not null
# status :integer default("active")
# support_email :string(100)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_accounts_on_status (status)
#
class Account < ApplicationRecord
# used for single column multi flags
@@ -79,6 +84,7 @@ class Account < ApplicationRecord
has_flags ACCOUNT_SETTINGS_FLAGS.merge(column: 'settings_flags').merge(DEFAULT_QUERY_SETTING)
enum locale: LANGUAGES_CONFIG.map { |key, val| [val[:iso_639_1_code], key] }.to_h
enum status: { active: 0, suspended: 1 }
before_validation :validate_limit_keys
after_create_commit :notify_creation