dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-12 00:09 UTC
ActiveRecord: created_at/_on / updated_at/_on data type
Quick question, before I monkey up my db. In ActiveRecord, regarding the magic column names created_at created_on updated_at updated_on They''re all mentioned in AWDWR and the API docs, but ... What data type do they each need to use? timestamp? datetime? What is the formatting returned as? A Ruby Time class object? Are they really updated automatically on creation / changes to a db row? Thanks for any help, John Joyce --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Conrad Taylor
2007-Aug-12 00:46 UTC
Re: ActiveRecord: created_at/_on / updated_at/_on data type
Hi, in the AWDwR on page 319 in the section tiltled "Magic Column Names", it says that _on will be mapped to date columns and _at will be mapped to datetime. Good luck, -Conrad On 8/11/07, dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org < dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Quick question, before I monkey up my db. > In ActiveRecord, regarding the magic column names created_at > created_on updated_at updated_on > > They''re all mentioned in AWDWR and the API docs, but ... > What data type do they each need to use? timestamp? datetime? > What is the formatting returned as? A Ruby Time class object? > Are they really updated automatically on creation / changes to a db > row? > > Thanks for any help, > John Joyce > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-12 04:29 UTC
Re: ActiveRecord: created_at/_on / updated_at/_on data type
Thanks, found it already. After posting of course. Used rails console to find the return types. Glad I learned Ruby before Rails! irb (console) is a good friend! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---