diff --git a/app/controllers/concerns/cache_concern.rb b/app/controllers/concerns/cache_concern.rb index a010fac165..05e431b19a 100644 --- a/app/controllers/concerns/cache_concern.rb +++ b/app/controllers/concerns/cache_concern.rb @@ -34,25 +34,7 @@ module CacheConcern raw = raw.cache_ids.to_a if raw.is_a?(ActiveRecord::Relation) return [] if raw.empty? - cached_keys_with_value = begin - Rails.cache.read_multi(*raw).transform_keys(&:id) - rescue NoMethodError - culprit = raw.find do |item| - Rails.cache.read(item) - false - rescue NoMethodError - true - end - - Rails.logger.warn "culprit: #{culprit.inspect}" - - cache_key = Rails.cache.send(:normalize_key, culprit, {}) - entry = Rails.cache.send(:read_entry, cache_key) - raw_marshal = Zlib::Inflate.inflate(entry.instance_variable_get(:@value)) - Rails.logger.warn "base64 marshal: #{Base64.encode64(raw_marshal)}" - raise - end - + cached_keys_with_value = Rails.cache.read_multi(*raw).transform_keys(&:id) uncached_ids = raw.map(&:id) - cached_keys_with_value.keys klass.reload_stale_associations!(cached_keys_with_value.values) if klass.respond_to?(:reload_stale_associations!)