diff --git a/app/dashboards/api_key_dashboard.rb b/app/dashboards/api_key_dashboard.rb index aad02cdd1..9616311dd 100644 --- a/app/dashboards/api_key_dashboard.rb +++ b/app/dashboards/api_key_dashboard.rb @@ -23,7 +23,8 @@ class ApiKeyDashboard < Administrate::BaseDashboard value: Field::String, created_at: Field::DateTime, updated_at: Field::DateTime, - expires_at: Field::DateTime + expires_at: Field::DateTime, + versions: Field::PaperTrail }.freeze, T::Hash[Symbol, T.untyped]) # COLLECTION_ATTRIBUTES @@ -53,6 +54,7 @@ class ApiKeyDashboard < Administrate::BaseDashboard daily_limit created_at updated_at + versions ].freeze, T::Array[Symbol]) # FORM_ATTRIBUTES diff --git a/app/models/api_key.rb b/app/models/api_key.rb index 265aac16e..9e50976fb 100644 --- a/app/models/api_key.rb +++ b/app/models/api_key.rb @@ -6,6 +6,7 @@ class ApiKey < ApplicationRecord belongs_to :user has_many :daily_api_usages, dependent: :destroy + has_paper_trail validates :value, uniqueness: true