Changed User model to not allow nil display_name (w/ tests)

This commit is contained in:
J Guthrie 2018-11-05 15:40:37 +00:00
parent e091246ffc
commit 6cde8c9b0c
2 changed files with 6 additions and 8 deletions

View file

@ -88,7 +88,7 @@ class User < ActiveRecord::Base
:default_url => "/assets/:class/:attachment/:style.png",
:styles => { :large => "100x100>", :small => "50x50>" }
validates :display_name, :presence => true, :allow_nil => true, :length => 3..255,
validates :display_name, :presence => true, :length => 3..255,
:exclusion => %w[new terms save confirm confirm-email go_public reset-password forgot-password suspended]
validates :display_name, :if => proc { |u| u.display_name_changed? },
:uniqueness => { :case_sensitive => false }