Hi everyone, I’d like some help to understand this method:
def self.authenticate(email, submitted_password)
user = find_by_email(email)
return nil if user.nil?
return user if user.has_password?(submitted_password)
# Don’t understand why it doesn’t return user instead of nil
# since ‘user = find_by_email(email)’ was the last evaluated
like the comment, I just don’t get it, if anyone could explain it to me,
please do it.