fix load engine error
This commit is contained in:
parent
553fb82adc
commit
f7638aa214
|
@ -105,6 +105,10 @@ module Announcement
|
||||||
puts ['there_was_no_show_option_method',e]
|
puts ['there_was_no_show_option_method',e]
|
||||||
end
|
end
|
||||||
if File.basename($0) != 'rake'
|
if File.basename($0) != 'rake'
|
||||||
|
gem_root = Announcement::Engine.root
|
||||||
|
require File.join(gem_root, 'app/models/bulletin_feed')
|
||||||
|
require File.join(gem_root, 'app/models/bulletin_feed_cache')
|
||||||
|
require File.join(gem_root, 'app/models/anns_cache')
|
||||||
begin
|
begin
|
||||||
avoid_page_cache AnnsCache
|
avoid_page_cache AnnsCache
|
||||||
avoid_page_cache BulletinFeedCache
|
avoid_page_cache BulletinFeedCache
|
||||||
|
|
|
@ -7,10 +7,9 @@ module Announcement
|
||||||
require File.join(gem_root, 'app/models/bulletin')
|
require File.join(gem_root, 'app/models/bulletin')
|
||||||
require File.join(gem_root, 'app/models/bulletin_feed')
|
require File.join(gem_root, 'app/models/bulletin_feed')
|
||||||
require File.join(gem_root, 'app/models/bulletin_feed_cache')
|
require File.join(gem_root, 'app/models/bulletin_feed_cache')
|
||||||
|
require File.join(gem_root, 'app/models/anns_cache')
|
||||||
|
|
||||||
require File.join(Announcement::Engine.root, 'app/models/anns_cache')
|
setting = AnnouncementSetting.first || AnnouncementSetting.create
|
||||||
|
|
||||||
setting = AnnouncementSetting.first
|
|
||||||
|
|
||||||
if !setting.migrate_flag.include?("v1")
|
if !setting.migrate_flag.include?("v1")
|
||||||
Bulletin.all.pluck(:id, :title).each do |id, title_translations|
|
Bulletin.all.pluck(:id, :title).each do |id, title_translations|
|
||||||
|
|
Loading…
Reference in New Issue