Hi all,
I've been tearing my hair out the past few days due to a simple problem I can't work out. Unfortunately I can't find any decent RoR forums so it's a bit of a long shot posting on here, but I'm hoping that someone can help!
I have the following code..
I get the following error message.. can't convert nil into String
If I look at the log it's printed the entire object (debug(u))..
But it hasn't printed the u.password..
Can someone help me as to why u.password doesn't work?
Thanks in advance,
Richard
I've been tearing my hair out the past few days due to a simple problem I can't work out. Unfortunately I can't find any decent RoR forums so it's a bit of a long shot posting on here, but I'm hoping that someone can help!
I have the following code..
Code:
def self.authenticate(user_info)
u = find_by_email(user_info[:email])
RAILS_DEFAULT_LOGGER.error(debug(u))
RAILS_DEFAULT_LOGGER.error('Password: '+u.password);
end
I get the following error message.. can't convert nil into String
If I look at the log it's printed the entire object (debug(u))..
Code:
ruby/object:User
attributes:
salt: "123"
id: "1"
password: "84fsd0fsj30j0jf3j0f0fsd80ssaa030j8e030j3"
But it hasn't printed the u.password..
Code:
TypeError (can't convert nil into String)
Can someone help me as to why u.password doesn't work?
Thanks in advance,
Richard