Skip to content

Commit

Permalink
make sure an email address and name is present and unique when a user…
Browse files Browse the repository at this point in the history
… or admin is created
  • Loading branch information
fortuity committed Mar 18, 2010
1 parent e9a87ea commit 6d39f42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/admin.rb
Expand Up @@ -5,4 +5,6 @@ class Admin < ActiveRecord::Base

# Setup accessible (or protected) attributes for your model
attr_accessible :name, :email, :password, :password_confirmation
validates_uniqueness_of :name, :email, :case_sensitive => false
validates_presence_of :name, :email
end
2 changes: 2 additions & 0 deletions app/models/user.rb
Expand Up @@ -7,4 +7,6 @@ class User < ActiveRecord::Base

# Setup accessible (or protected) attributes for your model
attr_accessible :name, :email, :password, :password_confirmation
validates_uniqueness_of :name, :email, :case_sensitive => false
validates_presence_of :name, :email
end

0 comments on commit 6d39f42

Please sign in to comment.