Fogbugz #63: Geburtsdatum auch bei Eingabe von nur Tag & Monat.

This commit is contained in:
gchq 2011-06-02 22:46:06 +02:00
parent e5e4d9e600
commit 34c4b6d9b1
2 changed files with 6 additions and 3 deletions

View file

@ -6,8 +6,10 @@ class Contact < ActiveRecord::Base
accepts_nested_attributes_for :phones, :reject_if => lambda { |a| a[:nr].blank? }, :allow_destroy => true
def birth_date_string
s = birth_day or ""
s += birth_month or ""
s += birth_year or ""
s = birth_day.to_s || ""
s += "."
s += birth_month.to_s || ""
s += "."
s += birth_year.to_s || ""
end
end

View file

@ -2,6 +2,7 @@ ContactORama::Application.routes.draw do
devise_for :users
resources :birthday
resources :contacts
# The priority is based upon order of creation: