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

Fix order proposals by comments and follows using the column instead of a subquery #11976

Merged
merged 2 commits into from Nov 13, 2023

Conversation

fblupi
Copy link
Member

@fblupi fblupi commented Nov 9, 2023

🎩 What? Why?

First, I tried to fix it the same way I did with a similar issue (#11473) without any good result.

I tried a different solution and checked Proposals orderable.rb file. I saw it used a subquery to order by comments and follows instead of using the columns. These columns were created after the concern and maybe that's the cause it wasn't them.

📌 Related Issues

Testing

  1. Go to a participatory space with a proposals component.
  2. Go to the proposals component.
  3. Filter by scope.
  4. Order by "most commented" or "most followed" and see it works.

📷 Screenshots

Screen.Recording.2023-11-09.at.17.21.01.mov

♥️ Thank you!

@fblupi fblupi added module: proposals type: fix PRs that implement a fix for a bug labels Nov 9, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 9, 2023
@fblupi fblupi marked this pull request as ready for review November 9, 2023 16:48
@fblupi fblupi requested a review from a team November 9, 2023 17:36
@andreslucena andreslucena self-assigned this Nov 10, 2023
Copy link
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised.

There is an approval from me, but @andreslucena has the final say.

@alecslupu alecslupu added this to the 0.28.0 milestone Nov 10, 2023
@fblupi fblupi changed the title Fix order by comments and follows using the column instead of a subquery Fix order proposals by comments and follows using the column instead of a subquery Nov 10, 2023
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏽 tried it locally and it works great, thanks!

@andreslucena
Copy link
Member

Only failing spec is codecov, so I'm ignoring it.

@andreslucena andreslucena merged commit 0392d30 into develop Nov 13, 2023
53 of 54 checks passed
@andreslucena andreslucena deleted the fix/11975 branch November 13, 2023 14:54
fblupi added a commit that referenced this pull request Nov 13, 2023
…of a subquery (#11976)

* Fix order by comments and follows using the column instead of a subquery

* Add spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: proposals type: fix PRs that implement a fix for a bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Error ordering proposals after filter them by scope
3 participants