1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/connection_adapters
eileencodes 1c98e6c005
Ensure the reading connection always raises if we try to write
Since test fixtures share connections (due to transactional tests) we
end up overwriting the reading configuration so Rails doesn't recognize
it as a replica connection.

This change ensures that if we're using the `reading` role that
connections will always have prevent writes turned on.

If you need a replica connection that does not block writes, you should
use a different role name other than `:reading`.

The db selector test and connection handlers test have been updated to
test for these changes. In the db selector test we don't always have a
writing handler so I updated test fixtures to return if that's nil.

Lastly one test needed to be updated to use a different handler name due
to it needing to write to successfully test what it needs to test.

Fixes #37765
2020-01-09 18:34:28 -05:00
..
adapter_leasing_test.rb Rename the classes 2019-11-06 19:08:47 -05:00
connection_handler_test.rb Deprecate "primary" as a connection_specification_name for ActiveRecord::Base 2020-01-08 16:49:41 -05:00
connection_handlers_multi_db_test.rb Ensure the reading connection always raises if we try to write 2020-01-09 18:34:28 -05:00
connection_handlers_multi_pool_config_test.rb Fix making an extra db file after testing for sqlite3 2019-11-26 09:32:22 +09:00
merge_and_resolve_default_url_config_test.rb Move name key on configuration hash into DatabaseConfig 2019-12-17 15:59:49 -05:00
mysql_type_lookup_test.rb MySQL: Fix schema dumping enum and set columns correctly 2019-07-05 18:42:41 +09:00
schema_cache_test.rb Cache full MySQL version in schema cache 2019-04-11 12:57:19 -04:00
type_lookup_test.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00