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
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
On 12 Feb 2008, at 17:06, Greg W. 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 C. wrote:
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
On 12 Feb 2008, at 17:46, Greg W. wrote:
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:
On Feb 13, 2008, at 6:02 PM, Frederick C. wrote:
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs