mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
fixed a bug with mock paginate tag
This commit is contained in:
@@ -10,7 +10,6 @@ require 'rubygems'
|
|||||||
require 'active_support'
|
require 'active_support'
|
||||||
require 'yaml'
|
require 'yaml'
|
||||||
require 'digest/md5'
|
require 'digest/md5'
|
||||||
|
|
||||||
require 'shopify/liquid'
|
require 'shopify/liquid'
|
||||||
require 'shopify/database.rb'
|
require 'shopify/database.rb'
|
||||||
|
|
||||||
@@ -50,7 +49,7 @@ class ThemeProfiler
|
|||||||
$stdout.puts "* rendered template %s, content: %s" % [template_name, Digest::MD5.hexdigest(html)]
|
$stdout.puts "* rendered template %s, content: %s" % [template_name, Digest::MD5.hexdigest(html)]
|
||||||
|
|
||||||
# Uncomment to dump html files to /tmp so that you can inspect for errors
|
# Uncomment to dump html files to /tmp so that you can inspect for errors
|
||||||
#File.open("/tmp/#{File.basename(template_name)}.html", "w+") { |fp| fp <<html}
|
# File.open("/tmp/#{File.basename(template_name)}.html", "w+") { |fp| fp <<html}
|
||||||
end
|
end
|
||||||
|
|
||||||
RubyProf.stop
|
RubyProf.stop
|
||||||
@@ -70,8 +69,6 @@ class ThemeProfiler
|
|||||||
content_for_layout
|
content_for_layout
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,4 +41,5 @@ end
|
|||||||
|
|
||||||
if __FILE__ == $0
|
if __FILE__ == $0
|
||||||
p Database.tables['collections']['frontpage'].keys
|
p Database.tables['collections']['frontpage'].keys
|
||||||
|
#p Database.tables['blog']['articles']
|
||||||
end
|
end
|
||||||
@@ -37,7 +37,7 @@ class Paginate < Liquid::Block
|
|||||||
|
|
||||||
context['paginate'] = pagination
|
context['paginate'] = pagination
|
||||||
|
|
||||||
collection_size = context[@collection_name].size
|
collection_size = context[@collection_name].size
|
||||||
|
|
||||||
raise ArgumentError.new("Cannot paginate array '#{@collection_name}'. Not found.") if collection_size.nil?
|
raise ArgumentError.new("Cannot paginate array '#{@collection_name}'. Not found.") if collection_size.nil?
|
||||||
|
|
||||||
@@ -88,6 +88,6 @@ class Paginate < Liquid::Block
|
|||||||
end
|
end
|
||||||
|
|
||||||
def current_url
|
def current_url
|
||||||
"/collections/#{frontpage}"
|
"/collections/frontpage"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user