small fix for nil values
This commit is contained in:
parent
c5fe53d745
commit
fce3571a84
|
|
@ -106,11 +106,11 @@ module Admin::PropertyHiresHelper
|
||||||
if field
|
if field
|
||||||
case field.type.to_s.downcase
|
case field.type.to_s.downcase
|
||||||
when "date"
|
when "date"
|
||||||
print_format = print_format.gsub("{#{field_name}}", phire.send(field_name).strftime("%Y/%m/%d")) rescue print_format
|
print_format = print_format.gsub("{#{field_name}}", phire.send(field_name).strftime("%Y/%m/%d")) rescue print_format.gsub("{#{field_name}}", "")
|
||||||
when "datetime"
|
when "datetime"
|
||||||
print_format = print_format.gsub("{#{field_name}}", phire.send(field_name).strftime("%Y/%m/%d %H:%M")) rescue print_format
|
print_format = print_format.gsub("{#{field_name}}", phire.send(field_name).strftime("%Y/%m/%d %H:%M")) rescue print_format.gsub("{#{field_name}}", "")
|
||||||
else
|
else
|
||||||
print_format = print_format.gsub("{#{field_name}}", phire.send(field_name).to_s)
|
print_format = print_format.gsub("{#{field_name}}", phire.send(field_name).to_s) rescue print_format.gsub("{#{field_name}}", "")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
field = PHireField.where(:key => field_name, :property_id => phire.property_id).first
|
field = PHireField.where(:key => field_name, :property_id => phire.property_id).first
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue