How I built linkmoji in an hour
Eric Nakagawa

Useful and funny!

However I have to ask why you used a before save event to check the db for duplicates. It would seem that this could create a typical race condition that could possibly result in duplicate entries.

Wouldn’t it be better to set a unique index on the table and use something like a WHERE NOT EXISTS clause? (assuming the DBMS supports SQL)

I would like to hear how you handled this issue. (Curious as I’m a developer myself.)

Also, I wish you good luck with your awesome product!

Like what you read? Give Cafe Coder a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.