I''m using the date_select form helper for a date_of_birth field on an ActiveRecord object. When I try to save a date earlier than 1 Jan 1970, ActionController punts with ActiveRecord::MultiparameterAssignmentErrors. The message it gives is "1 error(s) on assignment of multiparameter attributes". I was able to catch the exception and look at it, and it is certainly complaining about saving the date_of_birth field. The controller line throwing the exception is: redirect_to :action => "longform" if @borrower.update_attributes(@params[''borrower'']) The view line for the date select is: <%= date_select ''borrower'', ''date_of_birth'', :start_year => 1900 %> Saving dates later than 1 Jan 1970 works fine (but then not everybody was born after 1970...). The development log does not show a line for the update query on requests that throw the exception. I''m using the SQLServer (yes, MS SQL) adapter - but that *shouldn''t* be the problem... Can anybody shed some light on this for me? Thanks in advance, Roger Robbins
Any luck on this? I have the same problem with MySQL. - Derek On 5/31/05, Roger Robbins <rrobbins-+9FQAZFMD0vCste6SmUHRhL4W9x8LtSr@public.gmane.org> wrote:> > I''m using the date_select form helper for a date_of_birth field on an > ActiveRecord object. When I try to save a date earlier than 1 Jan 1970, > ActionController punts with > ActiveRecord::MultiparameterAssignmentErrors. The message it gives is > "1 error(s) on assignment of multiparameter attributes". I was able to > catch the exception and look at it, and it is certainly complaining > about saving the date_of_birth field. > > The controller line throwing the exception is: > redirect_to :action => "longform" if > @borrower.update_attributes(@params[''borrower'']) > > The view line for the date select is: > <%= date_select ''borrower'', ''date_of_birth'', :start_year => 1900 > %> > > Saving dates later than 1 Jan 1970 works fine (but then not everybody > was born after 1970...). The development log does not show a line for > the update query on requests that throw the exception. I''m using the > SQLServer (yes, MS SQL) adapter - but that *shouldn''t* be the problem... > Can anybody shed some light on this for me? > > Thanks in advance, > > Roger Robbins > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Derek Haynes HighGroove Studios - http://www.highgroove.com Keeping it Simple. 404.593.4879
Figured it out - the SQL type "datetime" maps to the Ruby Class "Time" (which begins in 1970). Need to use the SQL type "date." - Derek On 8/16/05, Derek Haynes <derek.haynes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Any luck on this? I have the same problem with MySQL. > > - Derek > > On 5/31/05, Roger Robbins <rrobbins-+9FQAZFMD0vCste6SmUHRhL4W9x8LtSr@public.gmane.org> wrote: > > > > I''m using the date_select form helper for a date_of_birth field on an > > ActiveRecord object. When I try to save a date earlier than 1 Jan 1970, > > ActionController punts with > > ActiveRecord::MultiparameterAssignmentErrors. The message it gives is > > "1 error(s) on assignment of multiparameter attributes". I was able to > > catch the exception and look at it, and it is certainly complaining > > about saving the date_of_birth field. > > > > The controller line throwing the exception is: > > redirect_to :action => "longform" if > > @borrower.update_attributes(@params[''borrower'']) > > > > The view line for the date select is: > > <%= date_select ''borrower'', ''date_of_birth'', :start_year => 1900 > > %> > > > > Saving dates later than 1 Jan 1970 works fine (but then not everybody > > was born after 1970...). The development log does not show a line for > > the update query on requests that throw the exception. I''m using the > > SQLServer (yes, MS SQL) adapter - but that *shouldn''t* be the problem... > > Can anybody shed some light on this for me? > > > > Thanks in advance, > > > > Roger Robbins > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > Derek Haynes > HighGroove Studios - http://www.highgroove.com > Keeping it Simple. > 404.593.4879 >-- Derek Haynes HighGroove Studios - http://www.highgroove.com Keeping it Simple. 404.593.4879