add option to force DirectoryItem.refresh_period! to run even if user directory is disabled

This commit is contained in:
Neil Lalonde 2017-11-10 12:30:20 -05:00
parent 9dc9ca4ac0
commit ec3d800492
1 changed files with 2 additions and 2 deletions

View File

@ -25,10 +25,10 @@ class DirectoryItem < ActiveRecord::Base
period_types.each_key { |p| refresh_period!(p) }
end
def self.refresh_period!(period_type)
def self.refresh_period!(period_type, force: false)
# Don't calculate it if the user directory is disabled
return unless SiteSetting.enable_user_directory?
return unless SiteSetting.enable_user_directory? || force
since =
case period_type