Commit 599e44f2d2081ffd0d42313eea194da0ddb7d1a4

Authored by Andrew Kane
1 parent 0b8db094

Prefer per over per_page [skip ci]

lib/searchkick/relation.rb
... ... @@ -105,6 +105,7 @@ module Searchkick
105 105 spawn.per_page!(*args)
106 106 end
107 107 end
  108 + alias_method :per, :per_page
108 109  
109 110 def per_page!(value)
110 111 options[:per_page] = value
... ...
test/pagination_test.rb
... ... @@ -45,7 +45,7 @@ class PaginationTest < Minitest::Test
45 45  
46 46 def test_pagination_relation
47 47 store_names ["Product A", "Product B", "Product C", "Product D", "Product E", "Product F"]
48   - products = Product.search("product", relation: true).order(name: :asc).page(2).per_page(2).padding(1)
  48 + products = Product.search("product", relation: true).order(name: :asc).page(2).per(2).padding(1)
49 49 assert_equal ["Product D", "Product E"], products.map(&:name)
50 50 assert_equal "product", products.entry_name
51 51 assert_equal 2, products.current_page
... ...