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 (0.2ms) SELECT "users".* FROM "users" WHERE "users"."username" = ? LIMIT ? [["username", "sikachu"], ["LIMIT", 1]] (0.1ms) begin transaction User Create (1.9ms) INSERT INTO "users" ("username", "created