diff --git a/app/models/fetprofile.rb b/app/models/fetprofile.rb index 1731382..6af5773 100644 --- a/app/models/fetprofile.rb +++ b/app/models/fetprofile.rb @@ -54,10 +54,14 @@ end self.plz.to_s + ' ' + self.city.to_s + connector.to_s + self.street.to_s end def birthday + unless self.birth_month.nil? || self.birth_day.nil? if self.birth_year.nil? || self.birth_year.zero? Date.new( Date.today.year,self.birth_month,self.birth_day) else Date.new( self.birth_year,self.birth_month,self.birth_day) end + else + nil + end end end diff --git a/app/views/fetprofiles/_interninfo.html.erb b/app/views/fetprofiles/_interninfo.html.erb index 4ea0119..ab6f272 100644 --- a/app/views/fetprofiles/_interninfo.html.erb +++ b/app/views/fetprofiles/_interninfo.html.erb @@ -1,5 +1,5 @@
-Geburtstag <%= I18n.l(interninfo.birthday,format: :short) %> +Geburtstag <%= I18n.l(interninfo.birthday,format: :short) unless interninfo.birthday.nil?%>
Adresse: