This project is archived and is in readonly mode.
Query Cache not enabled for subsequent connections
Reported by Andrew Selder | February 25th, 2009 @ 11:47 PM | in 3.x
If I do the following
class Foo < ActiveRecord::Base establish_connection(:some_other_db) end
and set a breakpoint in one of my actions, here's what I get:
ActiveRecord::Base.connection.query_cache_enabled => true Foo.connection.query_cache_enabled => false.
Granted, I could do something like put an around filter in application_controller to activate caching on Foo, but it seems like the principle of least surprise would indicate that query cached be enabled for all models regardless of connection
Comments and changes to this ticket
-
David Trasbo July 1st, 2010 @ 07:55 PM
- Assigned user set to Ryan Bigg
- Importance changed from to
This issue is gone on
master
:➜ ticket_2077 script/rails g model foo ➜ ticket_2077 rake db:migrate (in /Users/dtrasbo/code/rails/railties/tmp/ticket_2077)
class Foo < ActiveRecord::Base establish_connection(:production) end
➜ ticket_2077 rake db:migrate RAILS_ENV=production (in /Users/dtrasbo/code/rails/railties/tmp/ticket_2077) ➜ tmp/ticket_2077 script/rails c Loading development environment (Rails 3.0.0.beta4) ruby-1.9.2-preview3 > ActiveRecord::Base.connection.query_cache_enabled => false ruby-1.9.2-preview3 > Foo.connection.query_cache_enabled => false
This ticket can be closed.
-
David Trasbo September 9th, 2010 @ 08:26 AM
- Assigned user changed from Ryan Bigg to Rohit Arondekar
Can be closed, see above.
-
Rohit Arondekar September 10th, 2010 @ 09:18 AM
- State changed from new to resolved
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>