Fix an issue where TestFixtures#fixture_path was returning an array. It is deprecated, but it should still return a string until it is removed. So, if multiple fixture_paths are configured, it just returns the first path.

This commit is contained in:
Andrew Novoselac 2023-03-24 13:29:34 -04:00
parent 995768e791
commit a35a2d0d15

@ -43,8 +43,12 @@ def set_fixture_class(class_names = {})
end
def fixture_path
ActiveRecord.deprecator.warn("TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2. Use #fixture_paths instead.")
fixture_paths
ActiveRecord.deprecator.warn(<<~WARNING)
TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2. Use #fixture_paths instead.
If multiple fixture paths have been configured with #fixture_paths, then #fixture_path will just return
the first path.
WARNING
fixture_paths.first
end
def fixture_path=(path)
@ -96,8 +100,12 @@ def uses_transaction?(method)
end
def fixture_path
ActiveRecord.deprecator.warn("TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2. Use #fixture_paths instead.")
fixture_paths
ActiveRecord.deprecator.warn(<<~WARNING)
TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2. Use #fixture_paths instead.
If multiple fixture paths have been configured with #fixture_paths, then #fixture_path will just return
the first path.
WARNING
fixture_paths.first
end
def run_in_transaction?