From cb4065aef7b111ceaebcec0762b15c851e08af3e Mon Sep 17 00:00:00 2001 From: wmcheng Date: Fri, 14 Jun 2019 01:26:53 +0800 Subject: [PATCH] Update property_hires_controller.rb show issue --- app/controllers/property_hires_controller.rb | 26 +++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/controllers/property_hires_controller.rb b/app/controllers/property_hires_controller.rb index ddc31cf..cf69536 100644 --- a/app/controllers/property_hires_controller.rb +++ b/app/controllers/property_hires_controller.rb @@ -79,7 +79,7 @@ class PropertyHiresController < ApplicationController "header" => t("property_hire.can_be_hired"), "value" => (property.can_be_hired ? "Yes" : "No") } - if !property_hire.purchase_date.blank? + if !property_hire.purchase_date.to_s.blank? data << { "header" => t("property_hire.purchase_date"), "value" => property.purchase_date.strftime("%Y-%m-%d") @@ -90,34 +90,36 @@ class PropertyHiresController < ApplicationController else owners = property.owner_profiles.collect{|mp| mp.name}.join(",") end - if !property_hire.owners.blank? + if !owners.blank? data << { "header" => t("property_hire.owners"), "value" => owners } end - if !property_hire.owner_email.blank? + if !property.owner_email.blank? data << { - "header" => t("property_hire.owner_email"), + "header" => t("property_hire.owner_email"), "value" => property.owner_email } end - if !property_hire.owner_phone.blank? + if !property.owner_phone.blank? data << { - "header" => t("property_hire.owner_phone"), + "header" => t("property_hire.owner_phone"), "value" => property.owner_phone } end - if !property_hire.price.blank? + if !property.price.blank? data << { - "header" => t("property_hire.price"), + "header" => t("property_hire.price"), "value" => property.price } + end + if !property.get_location_name.blank? + data << { + "header" => t("property_hire.location"), + "value" => property.get_location_name + } end - data << { - "header" => t("property_hire.location"), - "value" => property.get_location_name - } actions = [] if property.can_be_hired actions << {