username is default param to User

This commit is contained in:
Andrey Kumanyaev 2013-01-25 22:35:58 +04:00
parent df64bdffdf
commit 916165dfc4

View file

@ -143,6 +143,11 @@ class User < ActiveRecord::Base
#
# Instance methods
#
def to_param
username
end
def generate_password
if self.force_random_password
self.password = self.password_confirmation = Devise.friendly_token.first(8)