UUID Auto Generation In Ruby On Rails 7 With PSQL

preview_player
Показать описание
UUID's let you create obfuscated IDs that are most likely unique. This allows you to hide how many orders you've sold, while also allowing a frontend of your application to try generating IDs without needing its own API calls!

Join this channel to help support these videos:

Follow me on social media:

#Deanin #Software #Programming
Рекомендации по теме
Комментарии
Автор

I've been watching a lot of space videos in VR lately, and fell asleep watching one about uniqueness. Then I remembered this problem I ran into a while ago on another video we did that used UUIDs. So here's me talking a bit about the UUIDs.

Deanin
Автор

Currently working on my first real website to host my projects and give an about me. The day this was uploaded was the day I was thinking about how to implement uuid. Great video, you made it very easy to understand

danedalton
Автор

That’s neat !

Thank you for this lesson.

Just like you said UUIDs are helpful at covering up sensitive details.

gsiicam
Автор

Thanks for this video!, It is just what I was looking for 🎉

PudinDeveloper
Автор

Thanks for this unique video! I'm watching it for the second time because the first time I created a UUID, there was a conflict with nested routes and foreign keys. I want to figure out how to make these UUIDs work, even if there are ID dependencies.

anngel_eth
Автор

Thx man, very helpful! Can u explane pls why using uuid for comment in your example is a bad idea?

tvvladimir
Автор

I had an issue with pgcrypto on one of the cloud providers not playing nice. So I went ahead and added a before_create action on my model...

before_create do
self.id = SecureRandom.uuid if id.blank?
end

and in my migration

create_table :items, id: false, primary_key: :id do |t|
t.uuid :id, null: false, index: {unique: true}

I probably could have done less to make it work but it did everything I needed.

anagoo
join shbcf.ru