From 130cbb27cec473e55068ac8fbf3044c0c3113f4f Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 12 Dec 2014 18:52:56 +0100 Subject: [PATCH] Set a validation on :display_name --- app/models/user.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index b9a5617a..feb6240d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -26,6 +26,8 @@ class User < ActiveRecord::Base validates :screen_name, presence: true, format: { with: SCREEN_NAME_REGEX }, uniqueness: { case_sensitive: false } + validates :display_name, length: { maximum: 50 } + # validates :website, format: { with: WEBSITE_REGEX } def login=(login)