From dc717408fe1b6af1dc3c73e2e9e40d04fbc1c583 Mon Sep 17 00:00:00 2001 From: bohung Date: Tue, 30 Aug 2022 20:15:53 +0800 Subject: [PATCH] Update temp file --- temp_file/app/models/site.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/temp_file/app/models/site.rb b/temp_file/app/models/site.rb index 2068008..f736d7f 100644 --- a/temp_file/app/models/site.rb +++ b/temp_file/app/models/site.rb @@ -29,6 +29,7 @@ class Site field :accessibility_mode, type: Boolean, default: false field :redirect_404_to_home, 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_url, type: String, :default => "" field :database_info, type: Hash, :default => {} @@ -137,6 +138,11 @@ class Site mount_uploader :site_logo_1, ImageUploader mount_uploader :favicon, 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 # begin # cache_header(false)