nuringa

Untitled

Jan 27th, 2021
636
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 2.6.6 :023 > Permission.left_joins(:permissions_users).where.not(permissions_users: { user: User.first, board: Board.first }).distinct
  2.   User Load (1.1ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1  [["LIMIT", 1]]
  3.   Board Load (1.2ms)  SELECT "boards".* FROM "boards" ORDER BY "boards"."id" ASC LIMIT $1  [["LIMIT", 1]]
  4.   Permission Load (1.2ms)  SELECT DISTINCT "permissions".* FROM "permissions" LEFT OUTER JOIN "permissions_users" ON "permissions_users"."permission_id" = "permissions"."id" WHERE NOT ("permissions_users"."user_id" = $1 AND "permissions_users"."board_id" = $2) /* loading for inspect */ LIMIT $3  [["user_id", 1], ["board_id", 1], ["LIMIT", 11]]
  5.  
RAW Paste Data