Friday, September 20, 2024 2:55:06 AM
> settings

Customize


Authenticate

> public_id_concern.rb
# frozen_string_literal: true

module PublicIdConcern
  extend ActiveSupport::Concern

  included do
    before_create :set_public_id

    protected

    def set_public_id
      return unless public_id.nil?

      self.public_id = SecureRandom.uuid.delete("-")
    end
  end
end
All opinions represented herein are my own
- © 2024 itsthedevman
- build 340fbb8