This used in the expression user.update_attributes(params[:user])
So, nothing fancy here. But when I give in a date older than 1 january
1970, I get an error:
‘1 error(s) on assignment of multiparameter attributes’, which I don’t
have with > 1970.
I checked the log, and both times the parameters are passed just fine.
On Thu, Mar 15, 2007 at 04:07:14AM -0700, Joram wrote :
So, nothing fancy here. But when I give in a date older than 1 january
1970, I get an error:
‘1 error(s) on assignment of multiparameter attributes’, which I don’t
have with > 1970.
Eric: I tried it, but it’s still the same for me when I enter a date <
1970
Pierre-Alexandre:
The 1970 should have made me realize it was a problem corresponnding
to the class where the time was stored.
I read your link, that’s exactly what I need, but how can I apply the
patch suggested there?
If you use a date datatype at least in sqlite3 and sqlserver, you should
be in good shape. Just remember that any calculations must be done with
the Date class.
change_column :users, :birthdate, :date
Also, you might find this handy
User’s age in view:
<%=h ((Date.today - @user.date_of_birth)/365.25).round %>
Sorry i didn’t answer your mail, but I wasn’t at home the past days.
I’m still having the problem at the moment, but I’ll try your approach
and let you know if it worked (I’m not at my dev pc at the moment).
I already use your tip about the age, but I was wondering why you did
365.25 where I did 365.
After some thinking it struck me that I was forgotten about the leap
years! So thank you very much for the info!