module Quiver::Adapter::Memory::UuidPrimaryKey::ClassMethods

Public Instance Methods

next_pk() click to toggle source
# File lib/quiver/adapter/memory_uuid_primary_key.rb, line 10
def next_pk
  @pk_series ||= []

  new_pk = SecureRandom.uuid
  while @pk_series.include?(new_pk)
    new_pk = SecureRandom.uuid
  end

  @pk_series << new_pk
  new_pk
end