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

refactor: Prefer Model.reflections over private Model#_reflections. #2927

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

simi
Copy link
Contributor

@simi simi commented Jul 1, 2024

🚧 This targets 2.x branch.

  • _reflections returns different key type per Rails version

ℹ️ Model.reflections seems supported for 6.0+ (I have not checked earlier versions since those seems unsupported).

💡 This fixes issues at RubyGems.org with Rails 7.2 beta compatibility.

- `_reflections` returns different key type per Rails version
@adrianthedev
Copy link
Collaborator

adrianthedev commented Jul 8, 2024

@Paul-Bob please review this and it works, let's ship it for 2.0!

We should check out if we can port it to 3.0 as well.

@simi
Copy link
Contributor Author

simi commented Jul 8, 2024

I can update also to reflect_on_association, which seems better IMHO. Same should be applied to 3.x.

@adrianthedev
Copy link
Collaborator

OK. let's retry that one then. Maybe it works on your end!

Copy link
Contributor

This PR has been marked as stale because there was no activity for the past 15 days.

@github-actions github-actions bot added the Stale label Jul 25, 2024
@Paul-Bob
Copy link
Contributor

I can update also to reflect_on_association, which seems better IMHO. Same should be applied to 3.x.

Made this PR for version 3 that replace _reflections usage with reflect_on_association

@simi simi changed the title Prefer Model.reflections over private Model#_reflections. refactor: Prefer Model.reflections over private Model#_reflections. Jul 30, 2024
@simi simi marked this pull request as ready for review July 30, 2024 18:53
@simi
Copy link
Contributor Author

simi commented Jul 30, 2024

@Paul-Bob updated, I tried to keep changes minimal. Specs seems happy.

@github-actions github-actions bot removed the Stale label Aug 1, 2024
Copy link
Collaborator

@adrianthedev adrianthedev left a comment

Choose a reason for hiding this comment

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

Thanks @simi!

Let's ship this.

@binarygit binarygit merged commit c08e7d9 into avo-hq:2.x Aug 2, 2024
9 checks passed
@jpawlyn jpawlyn mentioned this pull request Aug 23, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants