Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 5b3a3d409bdd71be8a9f13a20b25e8de4fc284da 1 parent b3d67ba
@travishaynes authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/shopify-kaminari.rb
View
8 lib/shopify-kaminari.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.