Prepare to support ruby 3.3.

This commit is contained in:
邱博亞 2024-02-24 20:45:38 +08:00
parent d49edd789e
commit 3001b51332
1 changed files with 28 additions and 26 deletions

View File

@ -1,35 +1,37 @@
module AdBanner module AdBanner
class Engine < ::Rails::Engine class Engine < ::Rails::Engine
initializer "ad_banner" do initializer "ad_banner" do
OrbitApp.registration "AdBanner", :type => "ModuleApp" do Rails.application.config.to_prepare do
module_label "ad_banner.ad_banner" OrbitApp.registration "AdBanner", :type => "ModuleApp" do
base_url File.expand_path File.dirname(__FILE__) module_label "ad_banner.ad_banner"
widget_methods ["widget"] base_url File.expand_path File.dirname(__FILE__)
widget_settings [{"override_category_with"=>"banner","multiselect"=>false,"display_field"=>"title","enable_custom_widget_data"=>true}] widget_methods ["widget"]
# models_to_cache [:banner,:ad_image] widget_settings [{"override_category_with"=>"banner","multiselect"=>false,"display_field"=>"title","enable_custom_widget_data"=>true}]
taggable "Banner" # models_to_cache [:banner,:ad_image]
categorizable taggable "Banner"
authorizable categorizable
authorizable
side_bar do side_bar do
head_label_i18n 'ad_banner.ad_banner', icon_class: "icons-landscape" head_label_i18n 'ad_banner.ad_banner', icon_class: "icons-landscape"
available_for "users" available_for "users"
active_for_controllers (['admin/ad_banners','admin/ad_images']) active_for_controllers (['admin/ad_banners','admin/ad_images'])
head_link_path "admin_ad_banners_path" head_link_path "admin_ad_banners_path"
context_link 'ad_banner.all', context_link 'ad_banner.all',
:link_path=>"admin_ad_banners_path" , :link_path=>"admin_ad_banners_path" ,
:priority=>1, :priority=>1,
:active_for_action=>{'admin/ad_banners'=>"index"}, :active_for_action=>{'admin/ad_banners'=>"index"},
:available_for => 'users' :available_for => 'users'
context_link 'categories', context_link 'categories',
:link_path=>"admin_module_app_categories_path" , :link_path=>"admin_module_app_categories_path" ,
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'ad_banner').id}", :link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'ad_banner').id}",
:priority=>3, :priority=>3,
:active_for_action=>{'admin/ad_banners'=>'categories'}, :active_for_action=>{'admin/ad_banners'=>'categories'},
:active_for_category => 'AdBanner', :active_for_category => 'AdBanner',
:available_for => 'managers' :available_for => 'managers'
end
end end
end end
end end