username is default param to User
This commit is contained in:
parent
df64bdffdf
commit
916165dfc4
1 changed files with 5 additions and 0 deletions
|
@ -143,6 +143,11 @@ class User < ActiveRecord::Base
|
||||||
#
|
#
|
||||||
# Instance methods
|
# Instance methods
|
||||||
#
|
#
|
||||||
|
|
||||||
|
def to_param
|
||||||
|
username
|
||||||
|
end
|
||||||
|
|
||||||
def generate_password
|
def generate_password
|
||||||
if self.force_random_password
|
if self.force_random_password
|
||||||
self.password = self.password_confirmation = Devise.friendly_token.first(8)
|
self.password = self.password_confirmation = Devise.friendly_token.first(8)
|
||||||
|
|
Loading…
Add table
Reference in a new issue