aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/query_cache.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/query_cache.rb')
-rw-r--r--activerecord/lib/active_record/query_cache.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/query_cache.rb b/activerecord/lib/active_record/query_cache.rb
index a8af89fcb9..e1d77975d3 100644
--- a/activerecord/lib/active_record/query_cache.rb
+++ b/activerecord/lib/active_record/query_cache.rb
@@ -7,6 +7,8 @@ module ActiveRecord
else
connection.cache(&block)
end
+ rescue
+ yield # if the database is not present, don't let the cache spoil the party
end
# Disable the query cache within the block if Active Record is configured.