is it possible to get stable signed ids with tosignedglobalid?

Yes, you can get signed global ids. It’s not stable because by default, there is an expiration of 1 month in Rails.

To make your signed global ID stable, set the expiration to nil.

Appointment.last.to_signed_global_id(expires_in: nil).to_s

Calling the above code any number of times will now always generate the same string result, unless you change the signing key.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top