lib/page_up/pages.rb in page_up-0.0.11 vs lib/page_up/pages.rb in page_up-0.0.12
- old
+ new
@@ -5,10 +5,10 @@
def initialize collection, page, per_page, opts = {}
@page = parse page, 1
@per_page = parse per_page, 25
@origin = collection
@opts = opts
- super collection[page_range]
+ super (collection[page_range] || [])
end
def total_size
@opts.fetch(:total_size) { @origin.size }
end