This is a follow-up to this question has_many :through usage, simple, beginner question
Basically, I'd like to have a function in my Invoice class that gets all the LineItems but the following is not working:
so:
> @i=Invoice.find(1) # good
> @i.products # good works well
> @i.products.line_items # not working, undefined method line_items
based upon associations in previous question, should this be working? I think it should if I access products directly:
> @p=Product.find(1) # good
> @p.line_items # also good
How can I get back all the line items based upon this model?
thx