Make `maintain_test_schema` a module instance variable
Followup: https://github.com/rails/rails/pull/42442
This commit is contained in:
parent
957921443a
commit
f4a3bf06a1
|
@ -200,6 +200,9 @@ module ActiveRecord
|
||||||
singleton_class.attr_accessor :queues
|
singleton_class.attr_accessor :queues
|
||||||
self.queues = {}
|
self.queues = {}
|
||||||
|
|
||||||
|
singleton_class.attr_accessor :maintain_test_schema
|
||||||
|
self.maintain_test_schema = nil
|
||||||
|
|
||||||
##
|
##
|
||||||
# :singleton-method:
|
# :singleton-method:
|
||||||
# Specify a threshold for the size of query result sets. If the number of
|
# Specify a threshold for the size of query result sets. If the number of
|
||||||
|
|
|
@ -65,8 +65,6 @@ module ActiveRecord
|
||||||
# to the database while the app is running.
|
# to the database while the app is running.
|
||||||
class_attribute :enumerate_columns_in_select_statements, instance_accessor: false, default: false
|
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 :belongs_to_required_by_default, instance_accessor: false
|
||||||
|
|
||||||
class_attribute :strict_loading_by_default, instance_accessor: false, default: false
|
class_attribute :strict_loading_by_default, instance_accessor: false, default: false
|
||||||
|
|
|
@ -651,7 +651,7 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def maintain_test_schema! #:nodoc:
|
def maintain_test_schema! #:nodoc:
|
||||||
if ActiveRecord::Base.maintain_test_schema
|
if ActiveRecord.maintain_test_schema
|
||||||
suppress_messages { load_schema_if_pending! }
|
suppress_messages { load_schema_if_pending! }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue