# 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