method

inherited

v4.2.9 - Show latest stable - Class: Rails::Engine
inherited(base)
public

No documentation available.

# File railties/lib/rails/engine.rb, line 348
      def inherited(base)
        unless base.abstract_railtie?
          Rails::Railtie::Configuration.eager_load_namespaces << base

          base.called_from = begin
            call_stack = if Kernel.respond_to?(:caller_locations)
              caller_locations.map { |l| l.absolute_path || l.path }
            else
              # Remove the line number from backtraces making sure we don't leave anything behind
              caller.map { |p| p.sub(/:\d+.*/, '') }
            end

            File.dirname(call_stack.detect { |p| p !~ %[railties[\w.-]*/lib/rails|rack[\w.-]*/lib/rack] })
          end
        end

        super
      end