liquid
liquid copied to clipboard
Fix resource limit scores resetting on include
When include is used in a template, it'll go through Liquid::Template#render, which is called on a new template instance but with the same context. Meaning the "partial" that was included will keep using & updating the same Liquid::ResourceLimits instance. Among those updates though, there is an initial, unconditional reset of the scores done inside Liquid::Template#render.
After this fix, the reset will only be applied if the method was not called inside a partial context.