date now has a default nil value

This commit is contained in:
maxwell 2010-11-05 17:38:51 -07:00
parent e4f8f558a0
commit 4a39d1a516
3 changed files with 4 additions and 3 deletions

View file

@ -52,7 +52,8 @@ class PeopleController < ApplicationController
def update
# convert date selector into proper timestamp
birthday = params[:date]
if birthday
unless [:month, :day, :year].any?{|x| birthday[x].blank?}
params[:person][:profile][:birthday] ||= Date.parse("#{birthday[:year]}-#{birthday[:month]}-#{birthday[:day]}")
end

View file

@ -29,7 +29,7 @@ class Aspect
def to_s
name
end
def person_objects
person_ids = people.map{|x| x.person_id}
Person.all(:id.in => person_ids)

View file

@ -34,7 +34,7 @@
%h4
= t('.your_birthday')
%br
= select_date @person.profile.birthday, :order => [:month, :day, :year], :start_year => 1930, :end_year => 2000
= select_date @person.profile.birthday, :prompt => true, :default => true, :order => [:month, :day, :year], :start_year => 1930, :end_year => 2000
%h4
= t('.your_bio')