What''s the syntax to acquire the updated_at value of a session stored in a db? session.updated_at doesn''t work. can''t find any docs on this. -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 12 Feb 2008, at 17:06, Greg Willits wrote:> > What''s the syntax to acquire the updated_at value of a session stored > in a db? > > session.updated_at doesn''t work. can''t find any docs on this.I think you might just have to do it by hand - the session object is what you get from unmarshaling the blob of data from one column of the session table - the rest of the session table doesn''t make it past that level. You do get session.session_id to assist you with that. Fred
On Feb 12, 2008, at 9:36 AM, Frederick Cheung wrote:> On 12 Feb 2008, at 17:06, Greg Willits wrote: > >> What''s the syntax to acquire the updated_at value of a session stored >> in a db? >> >> session.updated_at doesn''t work. can''t find any docs on this. > > I think you might just have to do it by hand - the session object > is what you get from unmarshaling the blob of data from one column > of the session table - the rest of the session table doesn''t make > it past that level. > You do get session.session_id to assist you with that.Odd that updated_at wouldn''t be included, but OK, I can make my own session object interface then. Thanks. -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 12 Feb 2008, at 17:46, Greg Willits wrote:> > On Feb 12, 2008, at 9:36 AM, Frederick Cheung wrote: >> On 12 Feb 2008, at 17:06, Greg Willits wrote: >> >>> What''s the syntax to acquire the updated_at value of a session >>> stored >>> in a db? >>> >>> session.updated_at doesn''t work. can''t find any docs on this. >> >> I think you might just have to do it by hand - the session object >> is what you get from unmarshaling the blob of data from one column >> of the session table - the rest of the session table doesn''t make >> it past that level. >> You do get session.session_id to assist you with that. > > Odd that updated_at wouldn''t be included, but OK, I can make my own > session object interface then. Thanks.Turns out i was wrong, saw this today from jeremy:> You can use session.model to get at the underlying session record. > > You can even reopen CGI::Session::ActiveRecordStore::Session to add > associations if you like. > > jeremy--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Feb 13, 2008, at 6:02 PM, Frederick Cheung wrote:> On 12 Feb 2008, at 17:46, Greg Willits wrote: >> On Feb 12, 2008, at 9:36 AM, Frederick Cheung wrote: >>> On 12 Feb 2008, at 17:06, Greg Willits wrote: >>> >>>> What''s the syntax to acquire the updated_at value of a session >>>> stored in a db? >>>> >>>> session.updated_at doesn''t work. can''t find any docs on this. >>> >>> I think you might just have to do it by hand - the session object >>> is what you get from unmarshaling the blob of data from one column >>> of the session table - the rest of the session table doesn''t make >>> it past that level. >>> You do get session.session_id to assist you with that. >> >> Odd that updated_at wouldn''t be included, but OK, I can make my own >> session object interface then. Thanks.> Turns out i was wrong, saw this today from jeremy: > >> You can use session.model to get at the underlying session record. >> >> You can even reopen CGI::Session::ActiveRecordStore::Session to add >> associations if you like.Yeah, I just spotted the long version in The Rails Way last night, but .model is even better: session.model.updated_at gives me exactly what I wanted. :-) -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---