Remove deprecated TestFixtures.fixture_path

This commit is contained in:
Rafael Mendonça França 2023-11-06 16:49:32 +00:00
parent 4bf2c4cea1
commit f40a697e0f
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
3 changed files with 6 additions and 23 deletions

@ -1,3 +1,7 @@
* Remove deprecated `TestFixtures.fixture_path`.
*Rafael Mendonça França*
* Remove deprecated behavior to support referring to a singular association by its plural name.
*Rafael Mendonça França*

@ -53,20 +53,6 @@ def set_fixture_class(class_names = {})
self.fixture_class_names = fixture_class_names.merge(class_names.stringify_keys)
end
def fixture_path # :nodoc:
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) # :nodoc:
ActiveRecord.deprecator.warn("TestFixtures.fixture_path= is deprecated and will be removed in Rails 7.2. Use .fixture_paths= instead.")
self.fixture_paths = Array(path)
end
def fixtures(*fixture_set_names)
if fixture_set_names.first == :all
raise StandardError, "No fixture path found. Please set `#{self}.fixture_paths`." if fixture_paths.blank?
@ -111,15 +97,6 @@ def uses_transaction?(method)
end
private
def fixture_path
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?
use_transactional_tests &&
!self.class.uses_transaction?(name)

@ -136,6 +136,8 @@ Please refer to the [Changelog][active-record] for detailed changes.
* Remove deprecated behavior to support referring to a singular association by its plural name.
* Remove deprecated `TestFixtures.fixture_path`.
### Deprecations
* Deprecate `Rails.application.config.active_record.allow_deprecated_singular_associations_name`