Skip to content

Fix #6951. Use query cache/uncache, when using not only database.yml but also DATABASE_URL. - #8074

Merged
rafaelfranca merged 1 commit into
rails:masterfrom
kennyj:fix_6951
Oct 31, 2012
Merged

rafaelfranca merged 1 commit into
rails:masterfrom
kennyj:fix_6951

Conversation

@kennyj

@kennyj kennyj commented Oct 30, 2012

Copy link
Copy Markdown
Contributor

This PR closes #6951.

If we use DATABASE_URL, ActiveRecord::Base.configurations is not populated. Thus we can't use query cache with DATABASE_URL.

See https://github.com/rails/rails/blob/master/activerecord/lib/active_record/query_cache.rb#L7

@rafaelfranca

Copy link
Copy Markdown
Member

@kennyj could you add a CHANGELOG entry?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should invert the unless..else block here, wdyt?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some people really really really hate unless/else, but it doesn't bother me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe.. I don't hate, but I try to avoid :)

@kennyj

kennyj commented Oct 31, 2012

Copy link
Copy Markdown
Contributor Author

Thanks guys. I don't like unless .. else too :)
I update and added a CHANGELOG entry.

rafaelfranca added a commit that referenced this pull request Oct 31, 2012
Fix #6951. Use query cache/uncache, when using not only database.yml but also DATABASE_URL.
@rafaelfranca
rafaelfranca merged commit 85039d4 into rails:master Oct 31, 2012
kennyj added a commit to kennyj/rails that referenced this pull request Nov 13, 2012
…g not only database.yml but also DATABASE_URL.
rafaelfranca added a commit that referenced this pull request Nov 13, 2012
Backport #8074 to 3-2-stable. Use query cache/uncache, when using not only database.yml but also DATABASE_URL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cache and uncached do not work when using DATABASE_URL (such as on Heroku)

4 participants