Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4792 from rafaelfranca/build-fix

Only add ActiveRecord configuration if it is present
  • Loading branch information...
commit 40b218977ecf171852f6b00587b77602edf180de 2 parents bc194cf + 25a69e2
@josevalim josevalim authored
2  railties/lib/rails/generators/rails/app/templates/config/application.rb
@@ -59,7 +59,7 @@ class Application < Rails::Application
# 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
# 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? -%>
# Enable the asset pipeline.
1  railties/test/generators/app_generator_test.rb
@@ -202,6 +202,7 @@ def test_generator_if_skip_active_record_is_given
run_generator [destination_root, "--skip-active-record"]
assert_no_file "config/database.yml"
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_no_match(/fixtures :all/, helper_content)
Please sign in to comment.
Something went wrong with that request. Please try again.