birthday nil fix
This commit is contained in:
@@ -54,10 +54,14 @@ end
|
|||||||
self.plz.to_s + ' ' + self.city.to_s + connector.to_s + self.street.to_s
|
self.plz.to_s + ' ' + self.city.to_s + connector.to_s + self.street.to_s
|
||||||
end
|
end
|
||||||
def birthday
|
def birthday
|
||||||
|
unless self.birth_month.nil? || self.birth_day.nil?
|
||||||
if self.birth_year.nil? || self.birth_year.zero?
|
if self.birth_year.nil? || self.birth_year.zero?
|
||||||
Date.new( Date.today.year,self.birth_month,self.birth_day)
|
Date.new( Date.today.year,self.birth_month,self.birth_day)
|
||||||
else
|
else
|
||||||
Date.new( self.birth_year,self.birth_month,self.birth_day)
|
Date.new( self.birth_year,self.birth_month,self.birth_day)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<p>
|
<p>
|
||||||
<b>Geburtstag</b> <%= I18n.l(interninfo.birthday,format: :short) %>
|
<b>Geburtstag</b> <%= I18n.l(interninfo.birthday,format: :short) unless interninfo.birthday.nil?%>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>Adresse:</b>
|
<b>Adresse:</b>
|
||||||
|
|||||||
Reference in New Issue
Block a user