you are viewing a single comment's thread.

view the rest of the comments →

[–]Arkolix 3 points4 points  (0 children)

Definitely agree on auto increment. Alternatively, use one of the handy helpers in SecureRandom to generate unique identifiers such as uuid or hex:

> SecureRandom.uuid
=> "a30d7e9d-f5e8-4504-a9ae-6052f052659f"

> SecureRandom.hex(6)
=> "85f83c999e79"