This commit is contained in:
邱博亞 2023-11-07 07:59:49 +08:00
parent 4ac9278f56
commit c3973df78c
3 changed files with 8 additions and 8 deletions

View File

@ -20,9 +20,9 @@ class AskCategorySetting
self.custom_fields = self.custom_fields.select{|k,v| v['delete'] != true}
need_recalc_sort = true
end
if need_recalc_sort
# if need_recalc_sort
self.recalc_sort(false)
end
# end
end
true
end

View File

@ -22,9 +22,9 @@ class AskSetting
self.custom_fields = self.custom_fields.select{|k,v| v['delete'] != true}
need_recalc_sort = true
end
if need_recalc_sort
# if need_recalc_sort
self.recalc_sort(false)
end
# end
true
end
after_save do

View File

@ -6,7 +6,7 @@ Rails.application.routes.draw do
s = OrbitHelper::SharedHash['current_site']['site'] rescue Site.first
update_flag = s.respond_to?(:tmp_flags)
need_update = !update_flag || !(s.tmp_flags.include?('askf1'))
need_update2 = !update_flag || !(s.tmp_flags.include?('askf2'))
need_update2 = !update_flag || !(s.tmp_flags.include?('askf3'))
if need_update
ask_setting = AskSetting.first
check_custom_fields = {}
@ -52,7 +52,7 @@ Rails.application.routes.draw do
a.migrate_old
end
if update_flag
Site.update_all("$push"=>{"tmp_flags"=>'askf2'})
Site.update_all("$push"=>{"tmp_flags"=>'askf3'})
end
end
end