Fix bug.
This commit is contained in:
parent
16edd24809
commit
ab6b79eb29
|
@ -137,8 +137,8 @@ module Admin::PropertyHiresHelper
|
||||||
property = Property.where(id: property_id).first
|
property = Property.where(id: property_id).first
|
||||||
if !property.nil?
|
if !property.nil?
|
||||||
email_set = property.hire_email_sets.select{|v| v.field_name == field_name}
|
email_set = property.hire_email_sets.select{|v| v.field_name == field_name}
|
||||||
title = property['title'].collect{|k,v| v}.select{|v| !v.to_s.empty?}.join('/')
|
title = property.title_translations.collect{|k,v| v}.select{|v| v.present?}.uniq.join('/')
|
||||||
note = property['note'].collect{|k,v| v}.select{|v| !v.to_s.empty?}.join('/')
|
note = property.note_translations.collect{|k,v| v}.select{|v| v.present?}.uniq.join('/')
|
||||||
content = "title:#{title}<br>note:#{note}"
|
content = "title:#{title}<br>note:#{note}"
|
||||||
mail_subject = I18n.t("property_hire.email_#{field_name}_success")
|
mail_subject = I18n.t("property_hire.email_#{field_name}_success")
|
||||||
email_set_content = nil
|
email_set_content = nil
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<% property = Property.where(id: @data['property_id']).first %>
|
<% property = Property.where(id: @data['property_id']).first %>
|
||||||
<% if !property.nil? %>
|
<% if !property.nil? %>
|
||||||
<h3><%= property['title'].collect{|k,v| v}.uniq.join('/') rescue nil %></h3>
|
<h3><%= property.title_translations.collect{|k,v| v}.select{|v| v.present?}.uniq.join('/') rescue nil %></h3>
|
||||||
<% I18n.with_locale(@data['locale']) do %>
|
<% I18n.with_locale(@data['locale']) do %>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
<% elsif ['purchase_date'].include?(k) %>
|
<% elsif ['purchase_date'].include?(k) %>
|
||||||
<%= v.strftime('%Y/%m/%d %H:%M') rescue nil %>
|
<%= v.strftime('%Y/%m/%d %H:%M') rescue nil %>
|
||||||
<% elsif ['property_usage','note'].include?(k) %>
|
<% elsif ['property_usage','note'].include?(k) %>
|
||||||
<%= property[k].collect{|k,v| v}.uniq.join('/') rescue nil %>
|
<%= property.send("#{k}_translations").collect{|k,v| v}.select{|v| v.present?}.uniq.join('/') rescue nil %>
|
||||||
<% elsif k=='owners' %>
|
<% elsif k=='owners' %>
|
||||||
<%= property.owner_profiles.collect{|v| v.name}.join(', ') %>
|
<%= property.owner_profiles.collect{|v| v.name}.join(', ') %>
|
||||||
<% elsif ['category','property_location'].include?(k) %>
|
<% elsif ['category','property_location'].include?(k) %>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= t('property_hire.email_edit_success') %>
|
<%= t('property_hire.email_edit_success') %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<h3><%= property['title'].collect{|k,v| v}.uniq.join('/') rescue nil %></h3>
|
<h3><%= property.title_translations.collect{|k,v| v}.select{|v| v.present?}.uniq.join('/') rescue nil %></h3>
|
||||||
<% I18n.with_locale(@data['locale']) do %>
|
<% I18n.with_locale(@data['locale']) do %>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
<% elsif ['purchase_date'].include?(k) %>
|
<% elsif ['purchase_date'].include?(k) %>
|
||||||
<%= v.strftime('%Y/%m/%d %H:%M') rescue nil %>
|
<%= v.strftime('%Y/%m/%d %H:%M') rescue nil %>
|
||||||
<% elsif ['property_usage','note'].include?(k) %>
|
<% elsif ['property_usage','note'].include?(k) %>
|
||||||
<%= property[k].collect{|k,v| v}.uniq.join('/') rescue nil %>
|
<%= property.send("#{k}_translations").collect{|k,v| v}.select{|v| v.present?}.uniq.join('/') rescue nil %>
|
||||||
<% elsif k=='owners' %>
|
<% elsif k=='owners' %>
|
||||||
<%= property.owner_profiles.collect{|v| v.name}.join(', ') rescue nil %>
|
<%= property.owner_profiles.collect{|v| v.name}.join(', ') rescue nil %>
|
||||||
<% elsif ['category','property_location'].include?(k) %>
|
<% elsif ['category','property_location'].include?(k) %>
|
||||||
|
|
Loading…
Reference in New Issue