David Kimura PRO said about 3 years ago on Friend Requests From Scratch :
➜  155-friend-requests-from-scratch-master bin/rails c
Loading development environment (Rails 5.2.5)
2.7.3 :001 > user = User.first
  User Load (0.1ms)  SELECT  "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ?  [["LIMIT", 1]]
 => #<User id: 1, email: "john@example.com", created_at: "2021-04-20 01:30:35", updated_at: "2021-04-20 01:30:35"> 
2.7.3 :002 > user2 = User.last
  User Load (0.3ms)  SELECT  "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT ?  [["LIMIT", 1]]
 => #<User id: 4, email: "eve@example.com", created_at: "2021-04-20 01:30:35", updated_at: "2021-04-20 01:30:35"> 
2.7.3 :003 > user.friend_request(user2)
  Friendship Exists (0.1ms)  SELECT  1 AS one FROM "friendships" WHERE "friendships"."user_id" = ? AND "friendships"."friend_id" = ? LIMIT ?  [["user_id", 1], ["friend_id", 4], ["LIMIT", 1]]
   (0.0ms)  begin transaction
  Friendship Create (0.6ms)  INSERT INTO "friendships" ("user_id", "friend_id", "created_at", "updated_at") VALUES (?, ?, ?, ?)  [["user_id", 1], ["friend_id", 4], ["created_at", "2021-04-20 01:30:59.662695"], ["updated_at", "2021-04-20 01:30:59.662695"]]
  Friendship Create (0.1ms)  INSERT INTO "friendships" ("user_id", "friend_id", "status", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?)  [["user_id", 4], ["friend_id", 1], ["status", 1], ["created_at", "2021-04-20 01:30:59.664399"], ["updated_at", "2021-04-20 01:30:59.664399"]]
   (0.7ms)  commit transaction
 => #<Friendship id: 2, user_id: 4, friend_id: 1, status: "requested", created_at: "2021-04-20 01:30:59", updated_at: "2021-04-20 01:30:59"> 
2.7.3 :004 > 

I downloaded the source and got it running and it still seems to work okay.

You do have two "has_many :connections" defined in the user model which is a bit odd.