diff options
3 files changed, 15 insertions, 30 deletions
diff --git a/railties/lib/generators/rails/app/templates/config/application.rb b/railties/lib/generators/rails/app/templates/config/application.rb index 78a355d2f4..2872d187ba 100644 --- a/railties/lib/generators/rails/app/templates/config/application.rb +++ b/railties/lib/generators/rails/app/templates/config/application.rb @@ -1,5 +1,19 @@ require File.expand_path('../boot', __FILE__) +<% unless options[:skip_activerecord] -%> +require 'rails/all' +<% else -%> +# Pick the frameworks you want: +# require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "active_resource/railtie" +require "rails/test_unit/railtie" +<% end -%> + +# Auto-require all bundled libraries. +Bundler.require + module <%= app_const_base %> class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. diff --git a/railties/lib/generators/rails/app/templates/config/boot.rb b/railties/lib/generators/rails/app/templates/config/boot.rb index 03396113e8..29c9d506e5 100644 --- a/railties/lib/generators/rails/app/templates/config/boot.rb +++ b/railties/lib/generators/rails/app/templates/config/boot.rb @@ -15,32 +15,3 @@ rescue LoadError # # require 'rubygems' end - -# Auto-require all bundled libraries. -Bundler.require - -<% unless options[:skip_activerecord] -%> -require 'rails/all' - -# To pick the frameworks you want, remove 'require "rails/all"' -# and list the framework railties that you want: -# -# require "active_support/railtie" -# require "active_model/railtie" -# require "active_record/railtie" -# require "action_controller/railtie" -# require "action_view/railtie" -# require "action_mailer/railtie" -# require "active_resource/railtie" -# require "rails/test_unit/railtie" -<% else -%> -# Pick the frameworks you want: -# require "active_model/railtie" -# require "active_record/railtie" -require "active_support/railtie" -require "action_controller/railtie" -require "action_view/railtie" -require "action_mailer/railtie" -require "active_resource/railtie" -require "rails/test_unit/railtie" -<% end -%> diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 76579adb26..9c70dcbc92 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -90,7 +90,7 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_activerecord_is_removed_from_frameworks_if_skip_activerecord_is_given run_generator [destination_root, "--skip-activerecord"] - assert_file "config/boot.rb", /# require "active_record\/railtie"/ + assert_file "config/application.rb", /# require "active_record\/railtie"/ end def test_prototype_and_test_unit_are_added_by_default |