loicginoux / joanne_project

joanne's project
2 stars 1 forks source link

Leaderboard bug #360

Open jdaudier opened 11 years ago

jdaudier commented 11 years ago

I think I was not supposed to show up on the Leaderboard, correct? Do you know what happened?

2013-07-10_2132

jdaudier commented 11 years ago

Hi Loic:

Is this a bug?

loicginoux commented 11 years ago

You can consider this as a bug. Note that it will show only for you so it's not a public bug. Others won't see you. For your information, the problem is here at line 68 of the file /app/controllers/users_controller.rb:


if @isInLeaderboard.nil?
        @current_user_position = User.in_leadeboard().where("leaderboard_points < ?",      @current_user.leaderboard_points ).count()
        @isInLeaderboard = ((@leaderboard_users.current_page * nb_leaderboard_users_per_page) >=  @current_user_position )
end

I calculate your position in the leaderboard and then decide if you are part of the leaderboard depending on the page we are on and your position but I don't take into account if you are a hidden user or not (like me and you).

Do you want me to fix it?

jdaudier commented 11 years ago

Before I never used to see myself. Did something change?

loicginoux commented 11 years ago

I guess it's because you were positioned before the 15th user in leaderboard... no? But what I don't understand is why you seem to be 16th even if you have 32 points and the 15th user has 0 points...

jdaudier commented 11 years ago

Can you look briefly into this bug you mentioned above?

But what I don't understand is why you seem to be 16th even if you have 32 points and the 15th user has 0 points...