refactor user find
This commit is contained in:
parent
0998ca3974
commit
2f5ce553e2
|
@ -1066,14 +1066,13 @@ class User < Principal
|
|||
|
||||
# refactor User model find function,
|
||||
# return anonymous user when can not find user id = user_id
|
||||
def self.find user_id
|
||||
user = User.new
|
||||
def self.find (*args, &block)
|
||||
begin
|
||||
user = super
|
||||
super
|
||||
rescue
|
||||
user = self.anonymous
|
||||
self.anonymous
|
||||
end
|
||||
user
|
||||
# super
|
||||
end
|
||||
# Salts all existing unsalted passwords
|
||||
# It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password))
|
||||
|
|
Loading…
Reference in New Issue