From f19810f5e5f2b410620bd5977be6b7b537c75bbe Mon Sep 17 00:00:00 2001 From: Bohung Date: Tue, 8 Mar 2022 15:46:54 +0800 Subject: [PATCH] Fix bug. --- lib/event_news_mod/engine.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/event_news_mod/engine.rb b/lib/event_news_mod/engine.rb index 8f88699..9c6bc58 100644 --- a/lib/event_news_mod/engine.rb +++ b/lib/event_news_mod/engine.rb @@ -1,7 +1,7 @@ require "yaml" module EventNewsMod class Engine < ::Rails::Engine - initializer "event_news" do + initializer "event_news_mod" do begin translate_data = Dir["#{EventNewsMod::Engine.root}/config/locales/*.yml"] .map{|yaml_file| YAML.load(File.read(yaml_file))} data = {} @@ -91,7 +91,10 @@ module EventNewsMod rescue => e puts ['error in event_news',e,e.backtrace] end - OrbitApp.registration "event_news", :type => "ModuleApp" do + OrbitApp.registration "event_news_mod", :type => "ModuleApp" do + db = ::Mongoid::Sessions.default + collection = db[:module_apps] + collection.update_many({key: 'event_news'},'$set'=>{key: 'event_news_mod', title: 'event_news_mod'}) module_label "event_news.event_news" base_url File.expand_path File.dirname(__FILE__) widget_methods ["widget","random_event_news_widget", "tag_cloud"]