1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Take --skip-activerecord into account boot.rb requires. [#3711 status:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Rizwan Reza 2010-01-17 02:04:38 +03:30 committed by José Valim
parent cf109342a7
commit e3898bda9c
3 changed files with 17 additions and 7 deletions

View file

@ -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

View file

@ -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:
#
@ -23,3 +25,12 @@ require 'rails/all'
# require "action_view/railtie"
# require "action_mailer/railtie"
# 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 -%>

View file

@ -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