Skip to content

Instantly share code, notes, and snippets.

@chadwilken
Last active July 20, 2017 18:53
Show Gist options
  • Save chadwilken/af996ff3b210949a6ebea0c153f00a01 to your computer and use it in GitHub Desktop.
Save chadwilken/af996ff3b210949a6ebea0c153f00a01 to your computer and use it in GitHub Desktop.
can_view_users_photos = current_user.has_permission?(Permission::VIEW_USERS_PHOTOS)
@projects.map do |project|
Rails.cache.fetch(['v1', "can-view-all-photo-#{can_view_users_photos}", 'recent', project]) do
render partial: 'v1/locations/recent/project', locals: { project: project, can_view_users: can_view_users_photos }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment