Reload page, model method goes missing

I have this weird problem. I have a belongs_to :order relationship on a
line_item model object.

In index.rhtml, I have:
<%= @line_item.order.Id %>

If I restart Webrick, the first time I load the index.rhtml page, the
page loads fine. But when I refresh the page (by refreshing the
browser), all of a sudden I get a rails error stating that method
“order” missing for <LineItem:#02838

All subsequent browser refreshes return the error, until I restart
Webrick. Then it’s the same thing, page loads without error the first
time, and all browser refreshes afterwards throw the error.

I know it’s not a browser caching issue because the LineItem object id
in the error changes with each refresh.

It’s as if Rails (or ActiveRecord) loses the model method after the
second request??

Any ideas?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs