diff options
author | Josef Šimánek <josef.simanek@gmail.com> | 2015-02-14 03:24:54 +0100 |
---|---|---|
committer | Josef Šimánek <josef.simanek@gmail.com> | 2015-02-21 23:03:10 +0100 |
commit | 6576f7354e50afb79881aaf3a6f50f4e81dfab70 (patch) | |
tree | 9f53674c07731b069c0890fb26ab3d64b4207e8b /railties/test/application | |
parent | bab3c7c63deee86305d80e24c4ea1124c0ec27d1 (diff) | |
download | rails-6576f7354e50afb79881aaf3a6f50f4e81dfab70.tar.gz rails-6576f7354e50afb79881aaf3a6f50f4e81dfab70.tar.bz2 rails-6576f7354e50afb79881aaf3a6f50f4e81dfab70.zip |
Require `belongs_to` by default.
Deprecate `required` option in favor of `optional` for belongs_to.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/rake_test.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 8d71b813e6..2bff21dae5 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -194,7 +194,10 @@ module ApplicationTests assert_no_match(/Errors running/, output) end - def test_scaffold_with_references_columns_tests_pass_by_default + def test_scaffold_with_references_columns_tests_pass_when_belongs_to_is_optional + app_file "config/initializers/active_record_belongs_to_required_by_default.rb", + "Rails.application.config.active_record.belongs_to_required_by_default = false" + output = Dir.chdir(app_path) do `rails generate scaffold LineItems product:references cart:belongs_to; bundle exec rake db:migrate test` |