FIX: use correct class variable to get notification levels.

This commit is contained in:
Vinoth Kannan 2019-11-11 18:57:14 +05:30
parent 12bc6ce8c1
commit 6e3601469c
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, notification_levels[:regular]] }
].flatten.map { |id| [id.to_i, self.notification_levels[:regular]] }
notification_levels += SiteSetting.default_categories_muted.split("|").map { |id| [id.to_i, notification_levels[:muted]] }
notification_levels += SiteSetting.default_categories_muted.split("|").map { |id| [id.to_i, self.notification_levels[:muted]] }
else
notification_levels = CategoryUser.where(user: guardian.user).pluck(:category_id, :notification_level)
end