Prepare to support ruby 3.3.

This commit is contained in:
邱博亞 2024-02-24 21:25:10 +08:00
parent 9abbb5d09b
commit 565a7fb8e4
1 changed files with 83 additions and 81 deletions

View File

@ -1,6 +1,7 @@
module CustomGallery
class Engine < ::Rails::Engine
initializer "custom_gallery" do
Rails.application.config.to_prepare do
begin
translate_data = Dir["#{CustomGallery::Engine.root}/config/locales/*.yml"] .map{|yaml_file| YAML.load(File.read(yaml_file))}
data = {}
@ -21,7 +22,7 @@ module CustomGallery
puts ['error in custom_gallery',e]
end
require File.expand_path('../../../app/models/custom_album_setting', __FILE__)
require File.join(CustomGallery::Engine.root, 'app/models/custom_album_setting')
if defined?(CustomAlbumSetting)
if CustomAlbumSetting.first.nil?
CustomAlbumSetting.create()
@ -93,3 +94,4 @@ module CustomGallery
end
end
end
end