From 8023b6f3440e42e460410e31a8f1d886620e9e94 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 5 Nov 2010 18:32:04 -0700 Subject: [PATCH] Check for birthday before putting in birthday paramaters --- app/controllers/people_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 8d0567a76..4e31975a6 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -51,10 +51,11 @@ class PeopleController < ApplicationController def update # convert date selector into proper timestamp - birthday = params[:date] - unless [:month, :day, :year].any?{|x| birthday[x].blank?} - params[:person][:profile][:birthday] ||= Date.parse("#{birthday[:year]}-#{birthday[:month]}-#{birthday[:day]}") + if birthday = params[:date] + unless [:month, :day, :year].any?{|x| birthday[x].blank?} + params[:person][:profile][:birthday] ||= Date.parse("#{birthday[:year]}-#{birthday[:month]}-#{birthday[:day]}") + end end # upload and set new profile photo