Skip to content

QueryCache works only for ActiveRecord::Base.connection #17921

@Fivell

Description

@Fivell

Hello, can you please advise about QueryCache middleware. By default it thinks that I'm using only one connection (ActiveRecord::Base.connection) and sql generated by models connected to other DBs are not cached

For instance cache works for this

class Item < ActiveRecord::Base
end

and doesn't work for this

class SlaveItem < ActiveRecord::Base
    establish_connection "#{Rails.env}_slave".to_sym
end

But manual says "Query caching is a Rails feature that caches the result set returned by each query"

SO thread http://stackoverflow.com/questions/4326250/why-is-rails-query-caching-not-working

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions