debian-mirror-gitlab/app/models/raw_usage_data.rb

11 lines
315 B
Ruby
Raw Normal View History

2020-10-24 23:57:45 +05:30
# frozen_string_literal: true
class RawUsageData < ApplicationRecord
validates :payload, presence: true
validates :recorded_at, presence: true, uniqueness: true
2021-04-29 21:17:54 +05:30
def update_version_metadata!(usage_data_id:)
self.update_columns(sent_at: Time.current, version_usage_data_id_value: usage_data_id)
2020-10-24 23:57:45 +05:30
end
end