The code is below. User is the name in my database, but it is saying it is an undefined method when it should not be. It is just a string value in my database. I have looked at all the other posts about this error but their solutions did not work for me. (I used scaffold btw so I don't know if that affects anything)
def self.login(user, password)
the_user = self.where(user: user, password:password)
if the_user.empty?
return ERR_BAD_CREDENTIALS
else
return the_user.user
end
end