Wednesday, July 15, 2026 12:53:18 AM
> api_token.rb
# frozen_string_literal: true

class ApiToken < ApplicationRecord
  attribute :token, :string
  attribute :active, :boolean, default: true
  attribute :comment, :string
  attribute :created_at, :datetime
  attribute :updated_at, :datetime

  before_save :create_token

  private

  def create_token
    self.token = SecureRandom.uuid.delete("-").upcase
  end
end
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 43aa0d7