ctran/annotate_models — pull request #70 by KL-7 (2012-01-29 11:22:09+00:00)
Title: Use ObjectSpace to locate models by their file names.

I changed a bit the way model classes are located. After requiring model file we scan `ObjectSpace` for the class that has underscored name matching relative file path inside the models directory.

This approach eliminates necessity to guess model name by file name that allow to process models with any kind of non-standard capitalization in class and module names.

Though, it still requires that underscored file name matches underscored model class name.

If the file is located not at the top level of the models directory then we assume that model is either nested in the corresponding chain of modules or is not nested at all.

To be more precise it's possible to capture state of `ObjectSpace` before requiring model file and after the file is required check `ObjectSpace` for new classes. In that case it'd be easier to spot the model itself, but there might be problem if for some reason model class was already loaded before explicit requiring its file. So, I'm not sure whether it's a good idea or not.

I might have broken some edge cases. If so, let me know. Otherwise I enabled one pending test case and added some new tests that all are passing now.