Prepare to support ruby 3.3.

This commit is contained in:
邱博亞 2024-02-24 21:17:48 +08:00
parent a790cc0c72
commit 9853601ffb
1 changed files with 2 additions and 2 deletions

View File

@ -2,8 +2,9 @@ module Feeds
class Engine < ::Rails::Engine
initializer "feeds" do
Rails.application.config.to_prepare do
gem_root = Feeds::Engine.root
if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console')
require File.expand_path('../../../app/models/site_feed_setting', __FILE__)
require File.join(gem_root, 'app/models/site_feed_setting')
if defined?(SiteFeedSetting)
if SiteFeedSetting.count==0
SiteFeedSetting.create
@ -52,7 +53,6 @@ module Feeds
end
end
gem_root = Feeds::Engine.root
gem_tmp = File.join(gem_root, 'tmp')
f = File.join(gem_tmp, "install_bash")
if File.exist?(f)