filling in the user model
This commit is contained in:
parent
2b95899071
commit
6f9519fce9
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user