This commit is contained in:
BoHung Chiu 2023-01-16 18:02:44 +08:00
parent 9aecf5963c
commit 3ba5d512cf
3 changed files with 4 additions and 5 deletions

View File

@ -805,6 +805,5 @@ class ApplicationFormsController < ApplicationController
template_data:{'application_form_id'=>application_form_id,'locale'=>I18n.locale,'extra_text'=> extra_text}.merge(extra_data), template_data:{'application_form_id'=>application_form_id,'locale'=>I18n.locale,'extra_text'=> extra_text}.merge(extra_data),
mail_lang: I18n.locale) mail_lang: I18n.locale)
end end
mail.save
end end
end end

View File

@ -65,10 +65,9 @@ class ApplicationFormSignup
self.process_stage = enable_idx.nil? ? 0 : (enable_idx + 1) self.process_stage = enable_idx.nil? ? 0 : (enable_idx + 1)
end end
if self.serial_number.nil? if self.serial_number.nil?
s = ApplicationFormSetting.first last_serial_number = ApplicationFormSetting.max(:last_serial_number).to_i
s.last_serial_number += 1 self.serial_number = last_serial_number + 1
self.serial_number = s.last_serial_number ApplicationFormSetting.update_all({"$inc"=>{"last_serial_number"=>1}})
s.save(:validate=>false)
end end
end end
after_destroy do after_destroy do

View File

@ -2,6 +2,7 @@ Rails.application.routes.draw do
locales = Site.first.in_use_locales rescue I18n.available_locales locales = Site.first.in_use_locales rescue I18n.available_locales
Thread.new do Thread.new do
ApplicationFormEmailSet.where(:field_name=>nil).destroy
end end
scope "(:locale)", locale: Regexp.new(locales.join("|")) do scope "(:locale)", locale: Regexp.new(locales.join("|")) do
namespace :admin do namespace :admin do