From 3a1b605a9f77c5cfa23bf7dea3fce6557431454f Mon Sep 17 00:00:00 2001 From: "Davis W. Frank" Date: Mon, 5 Feb 2024 15:23:32 -0800 Subject: [PATCH] Attempts to fix #9 by explicitly creating a new instance of InternalMetadata --- lib/test_data/determines_databases_associated_dump_time.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/test_data/determines_databases_associated_dump_time.rb b/lib/test_data/determines_databases_associated_dump_time.rb index 394ccc5..812e8f4 100644 --- a/lib/test_data/determines_databases_associated_dump_time.rb +++ b/lib/test_data/determines_databases_associated_dump_time.rb @@ -1,7 +1,8 @@ module TestData class DeterminesDatabasesAssociatedDumpTime def call - if (last_dumped_at = ActiveRecord::InternalMetadata.find_by(key: "test_data:last_dumped_at")&.value) + internal_metadata = ActiveRecord::InternalMetadata.new(ActiveRecord::Base.connection) + if (last_dumped_at = internal_metadata["test_data:last_dumped_at"]) Time.parse(last_dumped_at) end rescue ActiveRecord::StatementInvalid