Skip to content

Commit

Permalink
Attempts to fix testdouble#9 by explicitly creating a new instance of…
Browse files Browse the repository at this point in the history
… InternalMetadata
  • Loading branch information
infews committed Feb 5, 2024
1 parent 73db6b9 commit 3a1b605
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/test_data/determines_databases_associated_dump_time.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 3a1b605

Please sign in to comment.