which would give me exactly the error you're getting "X is not missing
constant Y"
I worked around the problem by taking the models out of the module and
just putting everything in the rake file. Not clean but it did the job
and the job only needed to be done once.
I'd be interested to know how your situation compares
Oh I thought I'd explained it in the previous message. I took the class
definitions out of the module, and moved them into the rake file. That
did the trick.
I suspect that the problem has something to do with the associations
being to ActiveRecords that are declared inside modules and then used
outside those modules. But I've not had a chance to play around to find
out.
Roy Pardee wrote:
> Well don't leave us hanging--how'd you fix it?
Oh I thought I'd explained it in the previous message. I took the class
definitions out of the module, and moved them into the rake file. That
did the trick.
If you were previously using require to require files in your app then
that can screw things up big time.
Frederick Cheung wrote:
> If you were previously using require to require files in your app then
> that can screw things up big time.
> Fred
A very mysterious clue! How would require mess things up? This is
something we all need to know. I certainly do, it's quite hard for me to
find out about all the little hidden undocumented tricks that one needs
to know to become a true pro.
Short version: because requiring files that could be loaded by rails'
dependency system confuses said system (in development mode)
long version: Required or Not ? - Space Vatican
Excellent explanation, I guessed it must be down to something like that
but didn't have time to muck around to find the correct solution so I
bodged it.
I think it might be a good idea to try and get your solution integrated
into the api documentation. I've googled around and found other people
wrestling with this issue and there will be more in the future. It's
nice to have a clear explanation in the official docs.