当我更新用户组的静音类别并选择“更新现有用户?”时,似乎没有更新。例如,请看用户 #8,他是 #42 组的成员,但缺少很多 category_user 行:
SQL 结果
- 确认用户 #8 在 #42 组中的成员身份
SELECT gu.*, g.name
FROM group_users gu
JOIN groups g ON gu.group_id = g.id
WHERE user_id=8 and gu.group_id = 42;
id | group_id | user_id | created_at | updated_at | owner | notification_level | first_unread_pm_at | name
------+----------+---------+----------------------------+----------------------------+-------+--------------------+----------------------------+-------------------
4207 | 42 | 8 | 2023-07-03 11:36:43.828233 | 2023-07-03 11:36:43.828233 | f | 3 | 2023-12-29 22:52:43.371588 | japanese-learners
- 显示用户 #8 当前的通知级别
SELECT cu.*, c.name, c.parent_category_id
FROM category_users cu
JOIN categories c ON cu.category_id = c.id
WHERE cu.user_id = 8;
id | category_id | user_id | notification_level | last_seen_at | name | parent_category_id
-------+-------------+---------+--------------------+--------------+---------------+--------------------
42289 | 1 | 8 | 0 | | Uncategorized |
5981 | 5 | 8 | 1 | | Reading | 7
7981 | 6 | 8 | 1 | | Watching | 7
215 | 7 | 8 | 1 | | Japanese |
6981 | 9 | 8 | 1 | | Book Clubs | 5
214 | 10 | 8 | 0 | | Korean |
2386 | 11 | 8 | 0 | | Reading | 10
4384 | 12 | 8 | 0 | | Watching | 10
3385 | 13 | 8 | 0 | | Book Clubs | 11
36995 | 16 | 8 | 0 | | German |
- 显示组 #42 的通知级别(更多)
SELECT gcnd.*, c.name, c.parent_category_id
FROM group_category_notification_defaults gcnd
JOIN categories c ON gcnd.category_id = c.id
WHERE group_id=42;
id | group_id | category_id | notification_level | name | parent_category_id
-----+----------+-------------+--------------------+---------------+--------------------
1 | 42 | 10 | 0 | Korean |
8 | 42 | 7 | 1 | Japanese |
11 | 42 | 13 | 0 | Book Clubs | 11
12 | 42 | 11 | 0 | Reading | 10
14 | 42 | 12 | 0 | Watching | 10
26 | 42 | 9 | 1 | Book Clubs | 5
27 | 42 | 6 | 1 | Watching | 7
28 | 42 | 5 | 1 | Reading | 7
97 | 42 | 16 | 0 | German |
174 | 42 | 21 | 0 | Book Clubs | 18
177 | 42 | 18 | 0 | Reading | 16
178 | 42 | 22 | 0 | Reading | 17
179 | 42 | 23 | 0 | Watching | 17
180 | 42 | 17 | 0 | Spanish |
181 | 42 | 19 | 0 | Watching | 16
182 | 42 | 25 | 0 | Book Clubs | 22
367 | 42 | 1 | 0 | Uncategorized |
有没有办法在 rails 控制台中手动运行这个“update_existing_users”进程?我对 rails 不是很了解,所以在代码中找不到它。我认为最好尝试手动运行它,看看问题是出在更新过程中还是触发更新的过程中。
如果有人有任何想法或帮助,请告诉我!
谢谢
额外信息:
我的网站:https://forums.learnnatively.com/
Discourse 版本:3.2.0.beta4-dev (46eec95719)