Concerned_with, and maybe require_dependency issues only when running specs?

Hi all,

So in the interests of keeping a few areas of my code a bit under
I’ve been investigating the concept of “concerned_with” as described

Basically allowing me to have:

class User < ActiveRecord::Base
concerned_with :something

class User < ActiveRecord::Base
def something_method

I realize that there might be better ways to deal with this same
issue…some of my code might be better off in separate classes, or
etc, but for now I’m hoping to try this out. And it’s working working
in my code, when I run the server, script/console, etc…

…everywhere except in my specs.

And, its working in my actual model spec just fine

But where it’s not working is in other specs that end up using the user
model, such as some controller specs, and view specs where things aren’t
fully stubbed/mocked out.

It seems like in those other specs, the User class doesn’t have
“something_method” defined. (the failure message is undefined_method
“something_method” for #Class:0x243626c

Anybody have any ideas? I have a feeling it’s related to
or something, but I’m not really sure. I’ve turned on logging in
require_dependency, and it seems like the files are being required. Any
would be great, thanks!


We are having the same issue. It works fine when config.cache_classes is
on. but when its turned off stuff breaks. The extra files are no longer

concerned_with seems to have an issue with eager loading. Right now
we’re looking at alternatives.