New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't find models in subdirectories correctly #200
Comments
Can you give an example of your model class?
|
|
Is this inclosed a module hierachy matching the directory structure? |
That is correct |
I can't seem to reproduce this. Please specify the gem version and a complete model file. |
I have this same issue. The problem might be that in both of our cases the class hierarchy does not match the directory structure. In my case the error message looks like this:
You'll notice that the path on the left, has an extra folder (
This seems to be a new bug, I didn't have this problem on version 2.6.3. |
I'm having this problem too:
Which is weird, because I don't understand why it looks on |
# app/models/data_values/text/code_phrase.rb
class CodePhrase < ActiveRecord::Base
belongs_to :CodePhraseable, polymorphic: true
end
# config/application.rb
config.autoload_paths += %W(#{config.root}/app/models/data_values/text) Then after the rescue block:
|
Have you tried to specify the "--model-dir" option? |
Further investigation seems to indicate that the problem only occurs when you have STI classes with the base class in a subdirectory. From my previous post, my It seems to find models that aren't STI in subdirectories just fine. Ex: it annotates |
I'm trying to mess with the |
I think, I've figured it out, working on a pull request now. |
I've got a pull request open that fixes this bug. #232 |
I have the following structure:
app/models/sub1/sub2/sub3
When annotating it correctly annotates models in sub1 classes but fails to annotate models in sub2 or sub3.
The error message says: Unable to annotate sub1/sub2/sub3/model.rb: cannot load such file -- path_to_app/app/models/sub2/sub3/model
The text was updated successfully, but these errors were encountered: