Fix namespace error in engine initialize.

This commit is contained in:
邱博亞 2025-03-15 12:09:53 +08:00
parent 9fd98b7888
commit 926c0f347a
1 changed files with 4 additions and 4 deletions

View File

@ -5,9 +5,9 @@ module Feeds
gem_root = Feeds::Engine.root
if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console')
require File.join(gem_root, 'app/models/site_feed_setting')
if defined?(SiteFeedSetting)
if SiteFeedSetting.count==0
SiteFeedSetting.create
if defined?(::SiteFeedSetting)
if ::SiteFeedSetting.count==0
::SiteFeedSetting.create
end
end
@ -26,7 +26,7 @@ module Feeds
authorizable
if File.basename($0) != 'rake'
begin
avoid_page_cache SiteFeed
avoid_page_cache ::SiteFeed
rescue => e
puts ["avoid_page_cache", e.to_s]
end