method

default_load_paths

Importance_0
v1.1.6 - Show latest stable - 0 notes - Class: Rails::Configuration
default_load_paths() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/initializer.rb, line 499
      def default_load_paths
        paths = ["#{root_path}/test/mocks/#{environment}"]
        
        # Add the app's controller directory
        paths.concat(Dir["#{root_path}/app/controllers/"])

        # Then model subdirectories.
        # TODO: Don't include .rb models as load paths
        paths.concat(Dir["#{root_path}/app/models/[_a-z]*"])
        paths.concat(Dir["#{root_path}/components/[_a-z]*"])

        # Followed by the standard includes.
        paths.concat %w(
          app 
          app/models 
          app/controllers
          app/helpers
          app/services
          app/apis 
          components 
          config 
          lib 
          vendor 
        ).map { |dir| "#{root_path}/#{dir}" }.select { |dir| File.directory?(dir) }

        # TODO: Don't include dirs for frameworks that are not used
        paths.concat %w(
          railties
          railties/lib
          actionpack/lib
          activesupport/lib
          activerecord/lib
          actionmailer/lib
          actionwebservice/lib
        ).map { |dir| "#{framework_root_path}/#{dir}" }.select { |dir| File.directory?(dir) }
      end
Register or log in to add new notes.