Skip to content

Commit

Permalink
Use kaminari's current_per_page
Browse files Browse the repository at this point in the history
This is cleaner than checking limit_value
  • Loading branch information
jhawthorn committed Dec 12, 2017
1 parent f421d5a commit f8b54cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/app/views/spree/api/shared/_pagination.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ json.count pagination.count
json.total_count pagination.total_count
json.current_page pagination.current_page
json.pages pagination.total_pages
json.per_page pagination.limit_value
json.per_page pagination.current_per_page
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
it "can page through the orders" do
get :index, params: { page: 2, per_page: 10 }
expect(assigns[:orders].offset_value).to eq(10)
expect(assigns[:orders].limit_value).to eq(10)
expect(assigns[:orders].current_per_page).to eq(10)
end
end

Expand Down

0 comments on commit f8b54cf

Please sign in to comment.