Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9943: rails_preinitializer_hook_ticket_9943.diff

File rails_preinitializer_hook_ticket_9943.diff, 1.2 kB (added by thewoolleyman, 1 year ago)

rails_preinitializer_hook_ticket_9943.diff

  • railties/environments/boot.rb

    old new  
    33RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) 
    44 
    55unless defined?(Rails::Initializer) 
     6  Dir["#{File.dirname(__FILE__)}/preinitializers/**/*.rb"].sort.each do |preinitializer| 
     7    load(preinitializer) 
     8  end 
     9 
    610  if File.directory?("#{RAILS_ROOT}/vendor/rails") 
    711    require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" 
    812  else 
  • railties/lib/rails_generator/generators/applications/app/app_generator.rb

    old new  
    5454      } 
    5555      m.template "configs/routes.rb",     "config/routes.rb" 
    5656      m.template "configs/apache.conf",   "public/.htaccess" 
     57       
     58      # Preinitializers directory 
     59      m.directory 'config/preinitializers' 
    5760 
    5861      # Initializers 
    5962      m.template "configs/initializers/inflections.rb", "config/initializers/inflections.rb"