Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe paging behavior is a little confusing? #69

Open
xofred opened this issue Jun 18, 2019 · 0 comments
Open

Maybe paging behavior is a little confusing? #69

xofred opened this issue Jun 18, 2019 · 0 comments

Comments

@xofred
Copy link

xofred commented Jun 18, 2019

Let's say we have a leaderboard with 2 pages, leaders(3) will return page 2 contents, which is confusing.

https://github.com/agoragames/leaderboard/blob/master/lib/leaderboard.rb#L714

if current_page > total_pages_in(leaderboard_name, page_size)
  current_page = total_pages_in(leaderboard_name, page_size)
end

I think, if something are not exist, should return empty array, like kaminari or other APIs design.

If it's design on purpose, maybe README should make this behavior clearly.

ps: Love your games since Facebook and Flash age. Thank you guys for the great works! And pardon my poor English.

@xofred xofred changed the title Maybe paging behavior is different from common sense? Maybe paging behavior is a little confusing? Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant