In this book: http://ruby.railstutorial.org/chapters/updating-showing-and-deleting-users#code:current_user_p
The author does the following:
def current_user
@current_user ||= User.find_by_remember_token(cookies[:remember_token])
end
def current_user?(user)
user == current_user
end
my question is when there is a comparison, user == current_user; what is rails comparing? user == @current_user? or user.name == @current_user.name ?
What would hapen if I had the following
def current_user
@current_user ||= User.find_by_remember_token(cookies[:remember_token])
@other_user ||= User.find_by_other_token(cookies[:other_token])
end
would ser == current_user compare other_user?