Add time zone preference (#25342)
This commit is contained in:
parent
16dd3f08c1
commit
4c9406bdb0
20 changed files with 32 additions and 17 deletions
|
@ -40,6 +40,7 @@
|
|||
# sign_up_ip :inet
|
||||
# role_id :bigint(8)
|
||||
# settings :text
|
||||
# time_zone :string
|
||||
#
|
||||
|
||||
class User < ApplicationRecord
|
||||
|
@ -99,6 +100,7 @@ class User < ApplicationRecord
|
|||
validates_with BlacklistedEmailValidator, if: -> { ENV['EMAIL_DOMAIN_LISTS_APPLY_AFTER_CONFIRMATION'] == 'true' || !confirmed? }
|
||||
validates_with EmailMxValidator, if: :validate_email_dns?
|
||||
validates :agreement, acceptance: { allow_nil: false, accept: [true, 'true', '1'] }, on: :create
|
||||
validates :time_zone, inclusion: { in: ActiveSupport::TimeZone.all.map { |tz| tz.tzinfo.name } }, allow_blank: true
|
||||
|
||||
# Honeypot/anti-spam fields
|
||||
attr_accessor :registration_form_time, :website, :confirm_password
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue