Check for birthday before putting in birthday paramaters
This commit is contained in:
parent
58c3a4306f
commit
8023b6f344
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue