diff options
Diffstat (limited to 'railties')
3 files changed, 17 insertions, 7 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index d58d245168..4b73576b07 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -87,7 +87,7 @@ module Rails::Generators end def create_boot_file - copy_file "config/boot.rb" + template "config/boot.rb" end def create_activerecord_files diff --git a/railties/lib/rails/generators/rails/app/templates/config/boot.rb b/railties/lib/rails/generators/rails/app/templates/config/boot.rb index 6de1725260..466e1e50ec 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/boot.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/boot.rb @@ -13,7 +13,9 @@ else require 'rubygems' end +<% 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: # @@ -22,4 +24,13 @@ require 'rails/all' # require "action_controller/railtie" # require "action_view/railtie" # require "action_mailer/railtie" -# require "active_resource/railtie"
\ No newline at end of file +# require "active_resource/railtie" +<% else -%> +# Pick the frameworks you want: +# require "active_record/railtie" +require "active_model/railtie" +require "action_controller/railtie" +require "action_view/railtie" +require "action_mailer/railtie" +require "active_resource/railtie" +<% end -%>
\ No newline at end of file diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 62ea07f14e..5fab233c8d 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -80,11 +80,10 @@ class AppGeneratorTest < GeneratorsTestCase assert_no_file "config/database.yml" end - # TODO: Bring this back using requires - # def test_activerecord_is_removed_from_frameworks_if_skip_activerecord_is_given - # run_generator ["--skip-activerecord"] - # assert_file "config/application.rb", /config\.frameworks \-= \[ :active_record \]/ - # end + 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"/ + end def test_prototype_and_test_unit_are_added_by_default run_generator |