mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Fix a regression in tablerow limit parameter.
I had accidentally read slice_collection_using_each as using to as an inclusive limit rather than exclusive, and no tests covered the offset or limit parameters.
This commit is contained in:
@@ -21,7 +21,7 @@ module Liquid
|
||||
collection = context[@collection_name] or return ''
|
||||
|
||||
from = @attributes['offset'] ? context[@attributes['offset']].to_i : 0
|
||||
to = @attributes['limit'] ? from + context[@attributes['limit']].to_i - 1 : nil
|
||||
to = @attributes['limit'] ? from + context[@attributes['limit']].to_i : nil
|
||||
|
||||
collection = Utils.slice_collection_using_each(collection, from, to)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user