From eb8b95125316f11b3321a4e57497bba8c38b6289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Wed, 21 Aug 2024 21:48:11 +0800 Subject: [PATCH] Fix Error --- app/views/email/p_hire_email.html.erb | 6 +++++- app/views/property_hires/hire.html.erb | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/email/p_hire_email.html.erb b/app/views/email/p_hire_email.html.erb index 8fb0ce7..e08ce2e 100644 --- a/app/views/email/p_hire_email.html.erb +++ b/app/views/email/p_hire_email.html.erb @@ -36,7 +36,11 @@ end fields_name = fields_name - basic_keys keys = basic_keys + fields_name - keys = keys.select{|field_name| tmp = property[field_name]; (tmp.is_a?(Hash) ? (tmp["enable"] == "1") : true) } + keys = keys.select do |field_name| + return true if field_name.include?('p_hire_fields.') + tmp = property[field_name] + tmp.is_a?(Hash) ? (tmp["enable"] == "1") : true + end p_hire_fields = property.p_hire_fields_enabled.map{|rf| [rf.id.to_s,rf]}.to_h has_p_hire_fields = p_hire_fields.count != 0 tmp_keys = [] diff --git a/app/views/property_hires/hire.html.erb b/app/views/property_hires/hire.html.erb index 29ba2a7..53589c6 100644 --- a/app/views/property_hires/hire.html.erb +++ b/app/views/property_hires/hire.html.erb @@ -797,12 +797,12 @@