Has anyone seen date_select default to the wrong date... all the time? we did a .13.1 install on the 22nd and all date selects on that box default to the 22nd whereas datetime_select defaults to ''today'' on textdrive... my app defaults to may 17th for date_selects _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Sean T Allen wrote:> Has anyone seen date_select default to the wrong date... > > all the time? > > we did a .13.1 install on the 22nd and all date selects on that box > default to the 22nd whereas datetime_select defaults to ''today'' > > on textdrive... my app defaults to may 17th for date_selects >following up on this... the textdrive app actually goes to the 19th of may... and looking at: class InstanceTag #:nodoc: include DateHelper def to_date_select_tag(options = {}) ... snip .. date = options[:include_blank] ? (value || 0) : (value || Date.today) ... snip... its because value is being set even when none is supplied... and for the life of me i can''t see how value gets set... anyone clue me in? _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Sean T Allen wrote:> Sean T Allen wrote: > >> Has anyone seen date_select default to the wrong date... >> >> all the time? >> >> we did a .13.1 install on the 22nd and all date selects on that box >> default to the 22nd whereas datetime_select defaults to ''today'' >> >> on textdrive... my app defaults to may 17th for date_selects >> > following up on this... the textdrive app actually goes to the 19th of > may... > > and looking at: > > class InstanceTag #:nodoc: > include DateHelper > > def to_date_select_tag(options = {}) > > ... snip .. > > date = options[:include_blank] ? (value || 0) : (value || > Date.today) > > ... snip... > > its because value is being set even when none is supplied... > > and for the life of me i can''t see how value gets set... > > anyone clue me in? >following up to myself still more... this error only occurs with psql not mysql but i still dont know how value gets set so i''m really stumped on how to fix this... assuming it hasnt already been fixed ( in the adapter? ) _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Anyone can feel free to shut me up... from the postgresql adapter... # author: Luke Holden <lholden-vvvqfg7xJ2Pk1uMJSBkQmQ@public.gmane.org <mailto:lholden-vvvqfg7xJ2Pk1uMJSBkQmQ@public.gmane.org>> # notes: Currently this adaptor does not pass the test_zero_date_fields # and test_zero_datetime_fields unit tests in the BasicsTest test # group. which would make a lot of sense for this bug... except that datetime_select works... _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Sean T Allen wrote:> Anyone can feel free to shut me up... > > from the postgresql adapter... > > # author: Luke Holden <lholden-vvvqfg7xJ2Pk1uMJSBkQmQ@public.gmane.org > <mailto:lholden-vvvqfg7xJ2Pk1uMJSBkQmQ@public.gmane.org>> > # notes: Currently this adaptor does not pass the test_zero_date_fields > # and test_zero_datetime_fields unit tests in the BasicsTest test > # group. > > which would make a lot of sense for this bug... > > except that datetime_select works... >at the end of the postgresql adapter # Fixed dates / times changing: return $1 if value =~ /^''(.+)''::(date|timestamp)/ to return nil if value =~ /^''(.+)''::(date|timestamp)/ fixes this problem... so what would i break if i patch that way on our systems? i can''t find anything that breaks yet... alas i have gotten to the point of knowing how to unit test something like this... how would i do that? _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails