aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-01-31 12:34:34 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-01-31 12:41:16 -0200
commit25a69e2ea51e419af8fc72dffdea94edb7e24e55 (patch)
tree8188916308ffb4f1d9bafe5900e79f854dd66d22 /railties
parent98e1735d1d622ad07a8441df4eb280d7a8e96a05 (diff)
downloadrails-25a69e2ea51e419af8fc72dffdea94edb7e24e55.tar.gz
rails-25a69e2ea51e419af8fc72dffdea94edb7e24e55.tar.bz2
rails-25a69e2ea51e419af8fc72dffdea94edb7e24e55.zip
Only add ActiveRecord configuration if it is present
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/application.rb2
-rw-r--r--railties/test/generators/app_generator_test.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb
index c3a87d30b4..acf47a03e5 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/application.rb
+++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb
@@ -59,7 +59,7 @@ module <%= app_const_base %>
# 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.
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 33a51fe782..e2c98274b1 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -202,6 +202,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
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)
end