Allow users to set/update their display name in LDAP #128

Merged
greg merged 6 commits from feature/123-display_names into master 2023-05-31 09:13:50 +00:00
Showing only changes of commit 445cdfa024 - Show all commits

View File

@ -33,7 +33,8 @@ class User < ApplicationRecord
validates_uniqueness_of :email
validates :email, email: true
validates_length_of :display_name, minimum: 3, maximum: 35, allow_blank: true
validates_length_of :display_name, minimum: 3, maximum: 35, allow_blank: true,
if: -> { defined?(@display_name) }
scope :confirmed, -> { where.not(confirmed_at: nil) }
scope :pending, -> { where(confirmed_at: nil) }