Update temp file

This commit is contained in:
BoHung Chiu 2022-08-30 20:15:53 +08:00
parent 79769962f3
commit dc717408fe
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,7 @@ class Site
field :accessibility_mode, type: Boolean, default: false field :accessibility_mode, type: Boolean, default: false
field :redirect_404_to_home, type: Boolean, default: false field :redirect_404_to_home, type: Boolean, default: false
field :block_cross_site_request, type: Boolean, default: false field :block_cross_site_request, type: Boolean, default: false
field :enable_csp_header, type: Boolean, default: false
field :member_extra_db, type: String, :default => "" field :member_extra_db, type: String, :default => ""
field :member_extra_url, type: String, :default => "" field :member_extra_url, type: String, :default => ""
field :database_info, type: Hash, :default => {} field :database_info, type: Hash, :default => {}
@ -137,6 +138,11 @@ class Site
mount_uploader :site_logo_1, ImageUploader mount_uploader :site_logo_1, ImageUploader
mount_uploader :favicon, ImageUploader mount_uploader :favicon, ImageUploader
mount_uploader :mobile_icon, ImageUploader mount_uploader :mobile_icon, ImageUploader
before_create do
if self.template.blank?
self.template = (Dir.glob("#{ENV['PWD']}/app/templates/*").collect{|temp| temp.split('/').last}-['mobile']).first
end
end
before_save do before_save do
# begin # begin
# cache_header(false) # cache_header(false)