As the documentation only shows examples using cached: true as option when rendering collections, I was wondering if it is possible to use a lambda to define multiple dependencies in a similar way as the render method;
<%= render partial: 'projects/project', collection: @projects, cached: -> project { [ project, current_user ] } %>
So could I use something similar with jbuilder?
json.projects current_user.projects, partial: 'projects/project', as: :project, cached: -> project { [ project, current_user ] }