You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is known limitation of using STI in development mode with lazy loading of classes. You need to use require_dependency to make Rails aware of those subclasses, e.g:
I have this kind of problem and can't get it working. My models are A, B (and more) < C, D (and more) < B.
After a code change, I get "uninitialized constant B". Tried require_dependency in a couple of ways, but don't really know 1) which class(es) to require (B?), and 2) where to do it.
These models are associated with other models in several ways, this might have an impact on the load order too (e.g. A belongs_to X, X has_many Bs and Cs)
I'm reopening issue #868 as it it still present today.
I've used ruby-1.9.3-p362 and rails 3.2.9
The only solution is to require child classes or to use
config.cache_classes = true
The text was updated successfully, but these errors were encountered: