views:

36

answers:

1

Hi All,

I recently upgraded from Rails 2.0.2 to 2.3.8 and have been ironing out the kinks. This one is baffling me.

I have a page that runs fine in production, but in development mode it runs fine on first load, then on reload it crashes with:

ActiveRecord::ConfigurationError - Association named 'average_prices' was not found; perhaps you misspelled it?

It's a nested eager-load call:

list_user.bookmarks.visible_to_user(logged_in_user_id).find(:all, :conditions=>filter, :include=>[:user, {:gift=>:average_prices}, :tags, :product_image])  

My feeling is that the error isn't strictly related to the real problem... aside from the fact that the code runs correctly (in production) I have also observed other errors sporadically in my app to the effect of:

A copy of [one of my helper classes] has been removed from the module tree but is still active!

Googling for this has resulted in much discussion of marking classes as "unloaded" and using "require_dependency" instead of "require"... but I've tried a number of things without any luck.

Does anyone have any clues here? Something seems funky to me with regard to loading/reloading classes.

NOTE: I think what I'm seeing is likely the same as this, but the fix posted here didn't work for me.

A: 

I've had similar problems when I was using certain plugins. Could this come from a plugin?

jordinl
Good idea (I've read that plugins can cause it) but I deleted my plugins folder altogether as a test, reworked the code so the parts that depended on them were commented out, and I'm still having the problem.
tlianza
Not sure how to fix this... A bad solution would be to set config.cache_classes = true in development.rb. But you'll have to restart the server every time you do a modification...
jordinl