filling in the user model

This commit is contained in:
Dan Buch 2011-08-09 21:40:23 -04:00
parent 2b95899071
commit 6f9519fce9

View File

@ -1,2 +1,10 @@
class User < ActiveRecord::Base class User < ActiveRecord::Base
validates_uniquness_of :username
validates_confirmation_of :password, :on => :create
validates_length_of :password, :within => 5..40
def self.authenticate(user_info)
find_by_username_and_password(user_info[:username],
user_info[:password])
end
end end