Hi,

I am trying to understand rails initialization process. While doing this I
came across following code snippet in "
https://github.com/rails/rails/blob/v2.3.8/railties/lib/initializer.rb"; file


I am not getting why "app/controllers" have been added twice in load_paths.
Is there any specific reason behind it?

def default_load_paths
        paths = []

        # Add the old mock paths only if the directories exists
        paths.concat(Dir["#{root_path}/test/mocks/#{environment}"]) if File.
exists?("#{root_path}/test/mocks/#{environment}")

        # Add the app's controller directory
        *paths.concat(Dir["#{root_path}/app/controllers/"])*

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

        paths.concat builtin_directories
end

Thanks and Regards,
Chirag Viradiya

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to