If I have an app/models/voucher.rb containing an ActiveRecord model, and also a plain Ruby object in app/models/voucher/foo.rb, and if I nest modules like:
Then I get "Unable to annotate voucher.rb: superclass mismatch for class Voucher"
If I instead do
it works fine. I'd rather use the former syntax since it has less surprising constant lookup and is easier to unit test.
There is a semantic difference between the 2 examples, isn't there?
Yeah, the two forms definitely behave differently in different situations. Different constant lookup, different behavior depending on load order etc.
I would guess this is either about foo.rb being loaded first, so voucher.rb can't then be loaded due to the mismatch (in which case the fix would be to address that load order); or that it tries to annotate foo.rb without having loaded voucher.rb first (in which case the fix would probably involve loading both files).
Fix the conversion from file path to class name which should fix #125 …
I fixed this problem in the develop branch.