Created
October 25, 2012 17:35
-
-
Save davidray/3954218 to your computer and use it in GitHub Desktop.
Let's say I have an index view with this kind of hierarchy...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= render sidebar #no caching | |
= render partial:patrol, collection:@patrols #has a cache key for patrol | |
= render partial:users, collection:patrol.users #has a cache key for user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake cache_digests:nested_dependencies TEMPLATE=manage/manage/index | |
[ | |
"manage/manage/sidebar", #Didn't expect this because I don't cache it (yet) | |
{ | |
"manage/manage/users": [ | |
{ | |
"manage/manage/patrol": [ #Expected this | |
"manage/manage/user", #Expected this | |
"manage/manage/add_new_member" #Expected this | |
] | |
}, | |
"manage/manage/add_new_member" #Expected this | |
] | |
} | |
] | |
I sort of expected it to only list the dependencies for which I had set up cacheing, rather than all the dependencies it could figure out. |
Ah, I see. Yeah, there's no way of doing that. This just shows the nested dependencies between templates. That's by design. Feel free to see if you can improve the message, though.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The second file is just pseudo-code to show the index page's rendering hierarchy. I added comments to show what I expected and didn't expect as output. I hope this makes sense.
Now that I understand that the rake task shows all the view dependencies whether or not the partials are cached, it makes sense and I think the rake task is correct. I was just wondering if the rake task should be explained in a way that people will not be confused as I was.