Sha256: ad28276fe005934222399f1c307a57c634024f1a6d91d1991a84bafcb130e836

Contents?: true

Size: 503 Bytes

Versions: 3

Compression:

Stored size: 503 Bytes

Contents

module TestData
  class DeterminesDatabasesAssociatedDumpTime
    def call
      if (last_dumped_at = ActiveRecord::InternalMetadata.find_by(key: "test_data:last_dumped_at")&.value)
        Time.parse(last_dumped_at)
      end
    rescue ActiveRecord::StatementInvalid
      # This will be raised if the DB exists but hasn't been migrated/schema-loaded
    rescue ActiveRecord::NoDatabaseError
      # This will be raised if the DB doesn't exist yet, which we don't need to warn about
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
test_data-0.3.2 lib/test_data/determines_databases_associated_dump_time.rb
test_data-0.3.1 lib/test_data/determines_databases_associated_dump_time.rb
test_data-0.3.0 lib/test_data/determines_databases_associated_dump_time.rb