Make `maintain_test_schema` a module instance variable

Followup: https://github.com/rails/rails/pull/42442
This commit is contained in:
Jean Boussier 2021-06-10 16:43:21 +02:00
parent 957921443a
commit f4a3bf06a1
3 changed files with 4 additions and 3 deletions

View File

@ -200,6 +200,9 @@ module ActiveRecord
singleton_class.attr_accessor :queues
self.queues = {}
singleton_class.attr_accessor :maintain_test_schema
self.maintain_test_schema = nil
##
# :singleton-method:
# Specify a threshold for the size of query result sets. If the number of

View File

@ -65,8 +65,6 @@ module ActiveRecord
# to the database while the app is running.
class_attribute :enumerate_columns_in_select_statements, instance_accessor: false, default: false
mattr_accessor :maintain_test_schema, instance_accessor: false
class_attribute :belongs_to_required_by_default, instance_accessor: false
class_attribute :strict_loading_by_default, instance_accessor: false, default: false

View File

@ -651,7 +651,7 @@ module ActiveRecord
end
def maintain_test_schema! #:nodoc:
if ActiveRecord::Base.maintain_test_schema
if ActiveRecord.maintain_test_schema
suppress_messages { load_schema_if_pending! }
end
end