Or rather, how does the determination work?
It takes place with the definition of the base.called_from in /lib/rails/engine.rb:
base.called_from
/lib/rails/engine.rb
d