Skip to content

Commit

Permalink
Merge pull request Shopify#1729 from alexevanczuk/ae-fix-deprecation-…
Browse files Browse the repository at this point in the history
…warning

Fix deprecation warning (fixture_path -> fixture_paths)
  • Loading branch information
KaanOzkan authored Dec 12, 2023
2 parents 30ad5e0 + 3b5e246 commit 5327dd1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/tapioca/dsl/compilers/active_record_fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ def fixture_loader
Class.new do
T.unsafe(self).include(ActiveRecord::TestFixtures)

T.unsafe(self).fixture_path = Rails.root.join("test", "fixtures")
if respond_to?(:fixture_paths=)
T.unsafe(self).fixture_paths = [Rails.root.join("test", "fixtures")]
else
T.unsafe(self).fixture_path = Rails.root.join("test", "fixtures")
end

# https://github.com/rails/rails/blob/7c70791470fc517deb7c640bead9f1b47efb5539/activerecord/lib/active_record/test_fixtures.rb#L46
singleton_class.define_method(:file_fixture_path) do
Rails.root.join("test", "fixtures", "files")
Expand Down

0 comments on commit 5327dd1

Please sign in to comment.