Hi there How do I see the time when the session was last updated? I''m using ActiveRecord store attributes.updated_at is not visible. /Kasper
Sorry for the ridiculous question, but is updated_at in the DB definition? -- -- Tom Mornini On Oct 20, 2005, at 7:08 AM, Kasper Weibel wrote:> Hi there > > How do I see the time when the session was last updated? I''m using > ActiveRecord > store > > attributes.updated_at is not visible. > > /Kasper > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
> Sorry for the ridiculous question, but is updated_at in the DB > definition?Yes, it''s the standard DDL definition an Active Record session store CREATE TABLE sessions ( id int(11) NOT NULL, sessid varchar(255) default NULL, "data" text, updated_at datetime default NULL, PRIMARY KEY (id), KEY session_index (sessid) ) And it works. What I want is to access the attribute updated_at, but I suspect it''s really not possible through the session. I have access to the sessid though, and can get updated_at that way through a DB request. It''s just a bit more work.
Hmmm. I took a quick look through the code and cannot find a simple way to get access to the AR object associated with an ActiveRecordStore object. -- -- Tom Mornini On Oct 20, 2005, at 2:34 PM, Kasper Weibel wrote:>> Sorry for the ridiculous question, but is updated_at in the DB >> definition? >> > > Yes, it''s the standard DDL definition an Active Record session store > > CREATE TABLE sessions ( > id int(11) NOT NULL, > sessid varchar(255) default NULL, > "data" text, > updated_at datetime default NULL, > PRIMARY KEY (id), > KEY session_index (sessid) > ) > > And it works. > > What I want is to access the attribute updated_at, but I suspect > it''s really not > possible through the session. I have access to the sessid though, > and can get > updated_at that way through a DB request. It''s just a bit more work. > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Oct 20, 2005, at 3:17 PM, Tom Mornini wrote:> Hmmm. I took a quick look through the code and cannot find a > simple way to get access to the AR object associated with an > ActiveRecordStore object.Look for session.model in the next release. For convenience, session delegates to session.model, so you may shorten session.model.updated_at to session.updated_at. jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDWD5NAQHALep9HFYRAj1aAKDLCQ8aULjl7EbalLAE3anCB9VkIQCdGmBS J3dFzJ2pmiuebJNTNgR3eAw=k9ZR -----END PGP SIGNATURE-----
Nice. Thanks. -- -- Tom Mornini On Oct 20, 2005, at 6:03 PM, Jeremy Kemper wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Oct 20, 2005, at 3:17 PM, Tom Mornini wrote: > > > >> Hmmm. I took a quick look through the code and cannot find a >> simple way to get access to the AR object associated with an >> ActiveRecordStore object. >> >> >> > > Look for session.model in the next release. For convenience, > session delegates to session.model, so you may shorten > session.model.updated_at to session.updated_at. > > jeremy > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2 (Darwin) > > iD8DBQFDWD5NAQHALep9HFYRAj1aAKDLCQ8aULjl7EbalLAE3anCB9VkIQCdGmBS > J3dFzJ2pmiuebJNTNgR3eAw> =k9ZR > -----END PGP SIGNATURE----- > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >