Is there a way to limit how many times a sgid can be used?
edimossilva opened this issue · comments
Edimo Silva commented
Is there a way for doing something similar to what is described bellow?
user = User.create(params)
uid = user.to_sgid(access_count: 1).to_s
GlobalID::Locator.locate_signed(uid) # => returns user
GlobalID::Locator.locate_signed(uid) # => returns nil
Rafael Mendonça França commented
You can implement you own locator that would keep track of the uid that it already saw, but I don't think you can embed that in the id itself.