Interesting (and useful!) behavior for how constants are looked up when multiple modules are included into a class. Constants within modules are prioritized over the included modules themselves.
module Namespace
class Foo
end
end
module Mixins
module Foo
end
end
class Base
include Namespace
include Mixins::Foo
p Foo
end
# => Namespace::Foo
This behavior prevents constant name shadowing when you include a module, but still want to access a class of the same name.
@postmodern I remember spending quite a while working out how this all worked when I wrote https://github.com/freerange/method_log
e.g. this spec: https://github.com/freerange/method_log/blob/ab50a74b951e756dd6e7bed86f746961971d7c31/spec/method_finder_spec.rb#L226
Fun times!