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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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
This topic is locked and can not be replied to.