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 category view of profiles #1338

Merged
merged 1 commit into from
Nov 29, 2023
Merged

Fix category view of profiles #1338

merged 1 commit into from
Nov 29, 2023

Conversation

zaziemo
Copy link
Member

@zaziemo zaziemo commented Nov 27, 2023

that was broken due to a huge amount of profiles that had to pass through the profile_card_details method.
We don't need to do that here because we can pass pagy different kinds of collections. We only need the pagy_arrays for the search results. All other types of results can be passed as an ActiveRecordRelation.

We also refactored the profile_card_details to be a Struct. This allows us to use the same partial to display the profile cards with the different kinds of collections.

that was broken due to a huge amount of profiles that had
to pass through the profile_card_details method.
We don't need to do that here because we can pass pagy different kinds
of collections. We only need the pagy_arrays for the search results.
All other types of results can be passed as an ActiveRecordRelation.

We also refactored the profile_card_details to be a Struct. This allows
us to use the same partial to display the profile cards with the
different kinds of collections.

Co-authored-by: Andy <andreas.hellwig@bitbirds.berlin>
@zaziemo zaziemo requested a review from A5308Y November 27, 2023 08:13
@A5308Y
Copy link
Contributor

A5308Y commented Nov 28, 2023

was broken due to a huge amount of profiles

It was still broken with 10 profiles IIRC. I'd say the reason was acts-as-taggable and how we didn't (still don't) understand how to prevent n+1 queries when using it.

Copy link
Contributor

@A5308Y A5308Y left a comment

Choose a reason for hiding this comment

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

LGTM!

@A5308Y
Copy link
Contributor

A5308Y commented Nov 28, 2023

I only looked at the code though. I didn't check it out and try it.

@zaziemo zaziemo merged commit 7290ca3 into master Nov 29, 2023
1 check passed
@zaziemo zaziemo deleted the bugs/fix-category-view branch November 29, 2023 18:22
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

Successfully merging this pull request may close these issues.

2 participants