谁能将我的 Sql 查询转换为 Rails 查询???
SELECT DISTINCT conversation_cbgs.* FROM "conversation_cbgs"
INNER JOIN "message_cbgs"
ON "message_cbgs"."conversation_cbg_id" = "conversation_cbgs"."id"
INNER JOIN "user_message_cbgs"
ON "user_message_cbgs"."message_cbg_id" = "message_cbgs"."id"
WHERE "user_message_cbgs"."user_id" = 1
ORDER BY conversations_cbgs.updated_at DESC