From 75ccdfed8d43d79f6590653212ecea7124759439 Mon Sep 17 00:00:00 2001 From: Lisa Ugray Date: Mon, 24 Jul 2017 14:17:56 -0400 Subject: Stop creating ApplicationRecord on model generation When generating models, we created ApplicationRecord in the default location if no file existed there. That was annoying for people who moved it to somewhere else in the autoload path. At this point, the vast majority of apps should have either run the upgrade script or generated a model since upgrading. For those that haven't the error message after generating a new model should be helpful: NameError: uninitialized constant ApplicationRecord To ease friction in that case, this also adds a generator for ApplicationRecord. --- railties/test/generators_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/test/generators_test.rb') diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb index e07627f36d..5063e864ca 100644 --- a/railties/test/generators_test.rb +++ b/railties/test/generators_test.rb @@ -124,7 +124,7 @@ class GeneratorsTest < Rails::Generators::TestCase def test_rails_generators_help_does_not_include_app_nor_plugin_new output = capture(:stdout) { Rails::Generators.help } - assert_no_match(/app/, output) + assert_no_match(/app\W/, output) assert_no_match(/[^:]plugin/, output) end -- cgit v1.2.3