Change: #900 メールアドレスの入力をオプション化 (#907)

This commit is contained in:
KMY(雪あすか) 2024-11-13 12:07:35 +09:00 committed by GitHub
parent 980074c5bd
commit 7b922c8af8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -131,8 +131,7 @@ class Form::AdminSettings
attr_accessor(*KEYS)
validates :registrations_mode, inclusion: { in: %w(open approved none) }, if: -> { defined?(@registrations_mode) }
validates :site_contact_email, :site_contact_username, presence: true, if: -> { defined?(@site_contact_username) || defined?(@site_contact_email) }
validates :site_contact_username, existing_username: true, if: -> { defined?(@site_contact_username) }
validates :site_contact_username, presence: true, existing_username: true, if: -> { defined?(@site_contact_username) }
validates :bootstrap_timeline_accounts, existing_username: { multiple: true }, if: -> { defined?(@bootstrap_timeline_accounts) }
validates :show_domain_blocks, inclusion: { in: %w(disabled users all) }, if: -> { defined?(@show_domain_blocks) }
validates :show_domain_blocks_rationale, inclusion: { in: %w(disabled users all) }, if: -> { defined?(@show_domain_blocks_rationale) }