From b9576dd669ce5ae690b4a1879491d56d6f385788 Mon Sep 17 00:00:00 2001 From: Benjamin Meichsner Date: Tue, 16 Feb 2010 09:53:24 +0100 Subject: [PATCH] Updated user validation. Fixed duplicates on 'nick'. --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 0bd19e1c..ffed3549 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -35,9 +35,9 @@ class User < ActiveRecord::Base validates_presence_of :nick, :email validates_presence_of :password_hash, :message => "Password is required." validates_length_of :nick, :in => 2..25 - validates_uniqueness_of :nick + validates_uniqueness_of :nick, :case_sensitive => false validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i - validates_uniqueness_of :email + validates_uniqueness_of :email, :case_sensitive => false validates_length_of :first_name, :in => 2..50 validates_confirmation_of :password validates_length_of :password, :in => 5..25, :allow_blank => true