Use create_or_find_by to avoid race condition in Rails 6.0
It’s pretty common in Ruby on Rails to use find_or_create_by
method when you want to create a new record if the record isn’t already existed:
> User.find_or_create_by(username: "sikachu")
User Load…