Forum: Ruby on Rails using ActiveRecord's query_cache for fun and profit

4890dffe125d62776be634e4d5209c57?d=identicon&s=25 Pitr Vernigorov (Guest)
on 2013-01-15 22:42
(Received via mailing list)
I need to store some data on a request basis and I was wondering how BAD
would it be to just stick it into ActiveRecord's query_cache. The way I
see
it, all the hard stuff is already done, like thread-safety. Suggestions?

ActiveRecord::Base.connection.query_cache['some']['var'] = 42
# later
ActiveRecord::Base.connection.query_cache['some']['var']

Thank you.
Ce5e201eca55d4f79d0ead9acc91d544?d=identicon&s=25 Dheeraj Kumar (Guest)
on 2013-01-16 04:56
(Received via mailing list)
Why not stick it into the session?

--
Dheeraj Kumar
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.