Skip to content

Commit

Permalink
Track changes on api keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Sep 11, 2024
1 parent 4c37280 commit f2cee65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/dashboards/api_key_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -53,6 +54,7 @@ class ApiKeyDashboard < Administrate::BaseDashboard
daily_limit
created_at
updated_at
versions
].freeze, T::Array[Symbol])

# FORM_ATTRIBUTES
Expand Down
1 change: 1 addition & 0 deletions app/models/api_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class ApiKey < ApplicationRecord

belongs_to :user
has_many :daily_api_usages, dependent: :destroy
has_paper_trail

validates :value, uniqueness: true

Expand Down

0 comments on commit f2cee65

Please sign in to comment.