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

Merge pull request #4792 from rafaelfranca/build-fix

Only add ActiveRecord configuration if it is present
This commit is contained in:
José Valim 2012-01-31 07:58:33 -08:00
commit 40b218977e
2 changed files with 2 additions and 1 deletions

View file

@ -59,7 +59,7 @@ module <%= app_const_base %>
# Specifies wether or not has_many or has_one association option :dependent => :restrict raises # Specifies wether or not has_many or has_one association option :dependent => :restrict raises
# an exception. If set to true, then an ActiveRecord::DeleteRestrictionError exception would be # an exception. If set to true, then an ActiveRecord::DeleteRestrictionError exception would be
# raised. If set to false, then an error will be added on the model instead. # raised. If set to false, then an error will be added on the model instead.
config.active_record.dependent_restrict_raises = false <%= comment_if :skip_active_record %>config.active_record.dependent_restrict_raises = false
<% unless options.skip_sprockets? -%> <% unless options.skip_sprockets? -%>
# Enable the asset pipeline. # Enable the asset pipeline.

View file

@ -202,6 +202,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
run_generator [destination_root, "--skip-active-record"] run_generator [destination_root, "--skip-active-record"]
assert_no_file "config/database.yml" assert_no_file "config/database.yml"
assert_file "config/application.rb", /#\s+require\s+["']active_record\/railtie["']/ assert_file "config/application.rb", /#\s+require\s+["']active_record\/railtie["']/
assert_file "config/application.rb", /#\s+config\.active_record\.dependent_restrict_raises = false/
assert_file "test/test_helper.rb" do |helper_content| assert_file "test/test_helper.rb" do |helper_content|
assert_no_match(/fixtures :all/, helper_content) assert_no_match(/fixtures :all/, helper_content)
end end