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]
|
||||
end
|
||||
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
|
||||
avoid_page_cache AnnsCache
|
||||
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_feed')
|
||||
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
|
||||
setting = AnnouncementSetting.first || AnnouncementSetting.create
|
||||
|
||||
if !setting.migrate_flag.include?("v1")
|
||||
Bulletin.all.pluck(:id, :title).each do |id, title_translations|
|
||||
|
|
Loading…
Reference in New Issue