Permalink
Browse files

fixed invalid Shopify query: was using :per instead of :limit

  • Loading branch information...
1 parent b3d67ba commit 5b3a3d409bdd71be8a9f13a20b25e8de4fc284da @travishaynes committed Sep 24, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/shopify-kaminari.rb
View
@@ -41,8 +41,8 @@ def paginate(options = {})
# create params for pagination
params = {
- :page => options[:page] || 1,
- :per => options[:per] || 25
+ :page => options[:page] || 1,
+ :limit => options[:per] || 25
}
# remove pagination params from options
@@ -64,8 +64,8 @@ def paginate(options = {})
# add instance methods to result Array to support paginating with Kaminari
result.instance_eval <<-EVAL
def current_page; #{args[:params][:page]}; end
- def num_pages; #{self.count / args[:params][:per] + 1}; end
- def limit_value; #{args[:params][:per]}; end
+ def num_pages; #{self.count / args[:params][:limit] + 1}; end
+ def limit_value; #{args[:params][:limit]}; end
EVAL
result

0 comments on commit 5b3a3d4

Please sign in to comment.