Hi, Has anyone here heard of or come up with a helper to allow the use of MySQL (or other) TIME fields? I found the issue listed at http://dev.rubyonrails.com/ticket/767 It appears this is not a priority for the developers. An application I''m currently trying to develop depends heavily upon the TIME data type. This is my first rails app, and I''m not sure I''m up to extending Rails yet to accomplish this. Anyone have any info? Thanks, Alison _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi ! Alison Rowland said the following on 2005-09-13 15:23:> Has anyone here heard of or come up with a helper to allow the use of > MySQL (or other) TIME fields? I found the issue listed at > http://dev.rubyonrails.com/ticket/767 It appears this is not a priority > for the developers. > > An application I''m currently trying to develop depends heavily upon the > TIME data type. This is my first rails app, and I''m not sure I''m up to > extending Rails yet to accomplish this. Anyone have any info?The way it works is Rails will convert the TIME column to a Time object, but in Ruby, the Time object includes date AND time. This allows nice carries when we add more than 24 hours, but at the same time it''s a pain to always format using strftime(''%H:%M'')... As far as I can tell, nothing untowards happens when you update using a Time object, like this: t = Time.local(2005, 1, 1, 14, 21) model.time = t; model.save! model.reload model.time.to_s #1970-01-01 14:21:00 Hope that helps ! François
I''m using time types now... w/ pgsql w/o any issues ( well after 1 patch to the pgsql interface )... what sort of issues are you hitting? Alison Rowland wrote:> Hi, > > Has anyone here heard of or come up with a helper to allow the use of > MySQL (or other) TIME fields? I found the issue listed at > http://dev.rubyonrails.com/ticket/767 It appears this is not a > priority for the developers. > > An application I''m currently trying to develop depends heavily upon > the TIME data type. This is my first rails app, and I''m not sure I''m > up to extending Rails yet to accomplish this. Anyone have any info? > > Thanks, > Alison > >------------------------------------------------------------------------ > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I was trying to set up a scaffold to start off with. I created one using ruby script/generate scaffold... it shows the names of all of my fields, but for instance, when I click on "new", it doesn''t give me any input field for the one bearing the TIME type. On the other hand, when I convert the field to DATETIME, it gives me a beautiful row of select boxes. Will it do that for you using TIME in Postgres? If it''s a MySQL issue, I''d be willing to switch over. On 9/13/05, Sean T Allen <sean-5W9FBhQXBOtBDgjK7y7TUQ@public.gmane.org> wrote:> > I''m using time types now... w/ pgsql w/o any issues ( well after 1 patch > to the pgsql interface )... > > what sort of issues are you hitting? > > Alison Rowland wrote: > > Hi, > > Has anyone here heard of or come up with a helper to allow the use of > MySQL (or other) TIME fields? I found the issue listed at > http://dev.rubyonrails.com/ticket/767 It appears this is not a priority > for the developers. > > An application I''m currently trying to develop depends heavily upon the > TIME data type. This is my first rails app, and I''m not sure I''m up to > extending Rails yet to accomplish this. Anyone have any info? > > Thanks, > Alison > > ------------------------------ > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Actually going back I did have some issues... 1. scaffolding was a no go... i had to move past it... 2. there was a bug that i submitted an as yet incorporated patch for... http://theredheadedstepchild.net/articles/2005/08/04/datehelper-fixes Alison Rowland wrote:> I was trying to set up a scaffold to start off with. I created one > using ruby script/generate scaffold... it shows the names of all of my > fields, but for instance, when I click on "new", it doesn''t give me > any input field for the one bearing the TIME type. On the other hand, > when I convert the field to DATETIME, it gives me a beautiful row of > select boxes. Will it do that for you using TIME in Postgres? If it''s > a MySQL issue, I''d be willing to switch over. > > > On 9/13/05, *Sean T Allen* <sean-5W9FBhQXBOtBDgjK7y7TUQ@public.gmane.org > <mailto:sean-5W9FBhQXBOtBDgjK7y7TUQ@public.gmane.org>> wrote: > > I''m using time types now... w/ pgsql w/o any issues ( well after 1 > patch to the pgsql interface )... > > what sort of issues are you hitting? > > Alison Rowland wrote: > >> Hi, >> >> Has anyone here heard of or come up with a helper to allow the >> use of MySQL (or other) TIME fields? I found the issue listed at >> http://dev.rubyonrails.com/ticket/767 It appears this is not a >> priority for the developers. >> >> An application I''m currently trying to develop depends heavily >> upon the TIME data type. This is my first rails app, and I''m not >> sure I''m up to extending Rails yet to accomplish this. Anyone >> have any info? >> >> Thanks, >> Alison >> >>------------------------------------------------------------------------ >> >>_______________________________________________ >>Rails mailing list >> >>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> >>http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Thank you for the link to the helper. That does exactly what I wanted -- to be able to use time_select in my view. I, too, found that once I started customizing the output of the scaffolding, the TIME field itself worked like a charm. --Alison On 9/13/05, Sean T Allen <sean-5W9FBhQXBOtBDgjK7y7TUQ@public.gmane.org> wrote:> > Actually going back I did have some issues... > > 1. scaffolding was a no go... i had to move past it... > 2. there was a bug that i submitted an as yet incorporated patch for... > > http://theredheadedstepchild.net/articles/2005/08/04/datehelper-fixes > > Alison Rowland wrote: > > I was trying to set up a scaffold to start off with. I created one using > ruby script/generate scaffold... it shows the names of all of my fields, but > for instance, when I click on "new", it doesn''t give me any input field for > the one bearing the TIME type. On the other hand, when I convert the field > to DATETIME, it gives me a beautiful row of select boxes. Will it do that > for you using TIME in Postgres? If it''s a MySQL issue, I''d be willing to > switch over. > > > On 9/13/05, Sean T Allen <sean-5W9FBhQXBOtBDgjK7y7TUQ@public.gmane.org> wrote: > > > > I''m using time types now... w/ pgsql w/o any issues ( well after 1 patch > > to the pgsql interface )... > > > > what sort of issues are you hitting? > > > > Alison Rowland wrote: > > > > Hi, > > > > Has anyone here heard of or come up with a helper to allow the use of > > MySQL (or other) TIME fields? I found the issue listed at > > http://dev.rubyonrails.com/ticket/767 It appears this is not a priority > > for the developers. > > > > An application I''m currently trying to develop depends heavily upon the > > TIME data type. This is my first rails app, and I''m not sure I''m up to > > extending Rails yet to accomplish this. Anyone have any info? > > > > Thanks, > > Alison > > > > ------------------------------ > > > > _______________________________________________ > > Rails mailing list > > > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > ------------------------------ > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails