0
0
Fork 0

Fix pt translations, improve pre-cache queries, removing will_paginate

from accounts/tags because it's a terribly inefficient way to paginate
large sets of data
This commit is contained in:
Eugen Rochko 2016-12-01 16:26:25 +01:00
parent bdf7d8f8fd
commit 1d0321fc45
10 changed files with 21 additions and 15 deletions

View file

@ -61,6 +61,7 @@ class ApplicationController < ActionController::Base
def cache_collection(raw, klass)
return raw unless klass.respond_to?(:with_includes)
raw = raw.select(:id, :updated_at).to_a if raw.is_a?(ActiveRecord::Relation)
uncached_ids = []
cached_keys_with_value = Rails.cache.read_multi(*raw.map(&:cache_key))