Project

General

Profile

Bug #34093

Updated by Tomer Brisker almost 3 years ago

The cache saves calculating the scope for the collection, but loads all records when calling `.include?` instead of checking for the existence of the specific record within the scope 
 <pre> 
 <code class="ruby"> 
   def collection_cache_lookup(subject, permission) 
     collection = @cache[subject.class.to_s][permission] ||= 
       find_collection(subject.class, :permission => permission) 

     collection.include?(subject) 
   end 
 </code> 
 </pre>

Back