dmbf29 / predictor-api

match prediction app / back-end API built on Rails
1 stars 4 forks source link

Add results to leaderboards endpoint #101

Closed trouni closed 1 year ago

trouni commented 1 year ago

This PR implements the following work:

As a post-deploy task, this needs to be run in the Heroku console after deployment to create the memberships for the leaderboard owners:

Leaderboard.find_each { |leaderboard| leaderboard.memberships.create(user: leaderboard.user) }

Fixes #98

trouni commented 1 year ago

@dmbf29 If you can review this, we could merge it to production already as it shouldn't break the current FE (you should probably test this locally against the main branch of the FE to make sure).

You will need to run this locally to make sure the leaderboard owner has a regular membership:

Leaderboard.find_each { |leaderboard| leaderboard.memberships.create(user: leaderboard.user) }
dmbf29 commented 1 year ago

@trouni do i need to run

Leaderboard.find_each { |leaderboard| leaderboard.memberships.create(user: leaderboard.user) }

in production then as well?

trouni commented 1 year ago

Yes indeed. It's just so that you and me (and other leaderboard owners) can still see the leaderboards that we created.

I'll wait a little bit to merge actually. I fixed some bugs while @jjmountain was developing, so just in case we find some other issues, I'll delay the merge.