I’m tring to write a little function to indicate if a user is able to
pay an invoice, I have my invoice model with:
if session[:user].id == self.consumer_id
as a method, but it gives the error:
“undefined local variable or method `session’ for #<Invoice:
Right before the method is called, I put a breakpoint, and session is
not nil, it has the user object in it as I expected it to.