Shopify/liquid — pull request #282 by boourns (2013-11-24 17:35:39+00:00)
Title: allow drops to optimize loading a slice of elements

@fw42 @dylanahsmith @jduff @camilo please review

Liquid users (sometimes) use loops like:

```
{ for i in collection.products limit: 5 }
```

Currently, we load all collection.products in this case because we collect the relevant members by iterating over the entire collection using `collection.each`.

This PR exposes a new method on liquid drops called 'load_slice', which, if implemented, returns the same subset as we already returned but the drop can optimize it's loading strategy to only load the records necessary.

This (and implementing `.load_slice`) will fix some worst-case scenarios where users use this method to collect data from the first element of over ~50 collections.