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:
Dylan Smith
2012-06-21 14:56:05 -04:00
parent d0184555d9
commit f5a20ff8e8
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -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)