class Rails::Engine

def inherited(base)

def inherited(base)
  unless base.abstract_railtie?
    Rails::Railtie::Configuration.eager_load_namespaces << base
    base.called_from = begin
      call_stack = caller_locations.map { |l| l.absolute_path || l.path }
      File.dirname(call_stack.detect { |p| !p.match?(%r[railties[\w.-]*/lib/rails|rack[\w.-]*/lib/rack]) })
    end
  end
  super
end