Create data_version.rb

Adds a model for DataVersion
This commit is contained in:
Justin Edmund 2025-01-10 00:39:48 -08:00
parent 8248b33d4b
commit 82eed14338

View file

@ -0,0 +1,13 @@
# frozen_string_literal: true
class DataVersion < ActiveRecord::Base
validates :filename, presence: true, uniqueness: true
validates :imported_at, presence: true
def self.mark_as_imported(filename)
create!(filename: filename, imported_at: Time.current)
end
def self.imported?(filename)
exists?(filename: filename)
end
end