FIX: remove magic numbers in notification levels.

ba5b78a348
This commit is contained in:
Vinoth Kannan 2019-11-11 18:18:33 +05:30
parent 0c0192e7da
commit 12bc6ce8c1
1 changed files with 2 additions and 2 deletions

View File

@ -207,9 +207,9 @@ class CategoryUser < ActiveRecord::Base
SiteSetting.default_categories_watching.split("|"),
SiteSetting.default_categories_tracking.split("|"),
SiteSetting.default_categories_watching_first_post.split("|"),
].flatten.map { |id| [id.to_i, 1] }
].flatten.map { |id| [id.to_i, notification_levels[:regular]] }
notification_levels += SiteSetting.default_categories_muted.split("|").map { |id| [id.to_i, 0] }
notification_levels += SiteSetting.default_categories_muted.split("|").map { |id| [id.to_i, notification_levels[:muted]] }
else
notification_levels = CategoryUser.where(user: guardian.user).pluck(:category_id, :notification_level)
end