Skip to content

Commit

Permalink
Added uniqueness and presence for user's username
Browse files Browse the repository at this point in the history
  • Loading branch information
gabceb committed Feb 20, 2013
1 parent a7eb71e commit 6c0ece5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/user.rb
Expand Up @@ -3,6 +3,8 @@ class User < ActiveRecord::Base
has_many :activities
before_save :ensure_authentication_token
before_save :ensure_gravatar_hash

validates :username, :presence => true, :uniqueness => true


# Kandan.devise_modules is defined in config/initializers/kandan.rb
Expand Down

0 comments on commit 6c0ece5

Please sign in to comment.