1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test
eileencodes 261cbcd2a8
Generate abstract class when generating scaffold in another database
This PR ensures that when you're generating a scaffold or model and that
model should belong to another database it will create an abstract class
if it doesn't already exist.

The new abstract class will ensure that the new model inherits from that
class, but will not be deleted if the scaffold is deleted. This is
because Rails can't know if you have other models inheriting from that
class so we don't want to revoke that if the scaffold is destroyed.

If the abstract class already exists it won't be created twice. If the
options for `parent` are set, the generator will use that as the
abstract class instead of creating one. The generated abstract class
will add the writing connection automatically, users need to add the
reading connection themselves as Rails doesn't know which is the reading
connection.

Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
2020-07-29 12:43:45 -04:00
..
application Generate abstract class when generating scaffold in another database 2020-07-29 12:43:45 -04:00
command Isolate ARGV in Rails::Command.invoke 2020-02-18 15:02:56 -06:00
commands Update Railties tests for 7e52d0a 2020-05-21 13:00:56 -04:00
configuration Delayed middleware delete does not allow move operations 2020-01-08 11:30:02 +02:00
engine Use the single line editor in console test 2019-12-24 20:47:21 +09:00
fixtures/lib
generators Generate abstract class when generating scaffold in another database 2020-07-29 12:43:45 -04:00
isolation require, require_relative, load by double quotes (#38841) 2020-03-29 16:30:52 -07:00
minitest
railties require, require_relative, load by double quotes (#38841) 2020-03-29 16:30:52 -07:00
test_unit Fixed up error output tests and added a missing failure output test. 2020-05-20 15:54:28 -07:00
abstract_unit.rb
app_loader_test.rb
backtrace_cleaner_test.rb Don't modify relative ./ paths in BacktraceCleaner 2019-10-03 14:06:58 -07:00
code_statistics_calculator_test.rb
code_statistics_test.rb
console_helpers.rb
engine_test.rb
env_helpers.rb
generators_test.rb remove reference to global rails command and replace with bin/rails 2019-12-27 19:32:37 +00:00
initializable_test.rb
json_params_parsing_test.rb
path_generation_test.rb
paths_test.rb
rack_logger_test.rb
rails_info_controller_test.rb
rails_info_test.rb
secrets_test.rb
version_test.rb