From ec3d80049226d208f661baa752916753a4cf7f5b Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 10 Nov 2017 12:30:20 -0500 Subject: [PATCH] add option to force DirectoryItem.refresh_period! to run even if user directory is disabled --- app/models/directory_item.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/directory_item.rb b/app/models/directory_item.rb index 4014f4d9c4d..ad82c2a6ed2 100644 --- a/app/models/directory_item.rb +++ b/app/models/directory_item.rb @@ -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