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

Allow Rails 7.2 #5843

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Allow Rails 7.2 #5843

wants to merge 11 commits into from

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Aug 29, 2024

Needs #5853

We need at least v3.7 of awesome_nested_set for Rails 7.2 support

Summary

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@tvdeyen tvdeyen self-assigned this Aug 29, 2024
@github-actions github-actions bot added changelog:solidus_core Changes to the solidus_core gem changelog:solidus_api Changes to the solidus_api gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_sample Changes to the solidus_sample gem changelog:solidus Changes to the solidus meta-gem changelog:solidus_admin labels Aug 29, 2024
Copy link
Contributor

@MadelineCollier MadelineCollier left a comment

Choose a reason for hiding this comment

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

How should we handle the error we get with Ransack 4.2 and above? It doesn't look like there has been any movement on the PR to fix the issue.

@tvdeyen
Copy link
Member Author

tvdeyen commented Sep 11, 2024

How should we handle the error we get with Ransack 4.2 and above? It doesn't look like there has been any movement on the PR to fix the issue.

That's a very good question. I need to read on the issue first in order to make an opinion. Since I use Ransack 4.2 with great success in several other apps and engines I am not sure why this is an issue in Solidus at all.

@tvdeyen
Copy link
Member Author

tvdeyen commented Sep 11, 2024

I looked into the problem and I am sure I can replace the custom ransacker with normal ransack. PR upcoming maybe tomorrow

Copy link
Contributor

@MadelineCollier MadelineCollier left a comment

Choose a reason for hiding this comment

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

Nice, thanks for addressing the root cause ❤️

We introduced a custom Ransacker to allow filtering producs by
their variants option values in the new admin interface.

This ransacker is broken in latest Ransack v4.2 and overly
complicated.  By introducing a option_values association to
products, that does the same join over variants_including_master
and their distinct option_values we can use normal ransack search.

Quoting the Ransack documentation:

> "Ransackers, like scopes, are not a cure-all. Many use cases can be better solved with a standard Ransack search on a dedicated database search field, which is faster, index-able, and scales better than converting/ransacking data on the fly."
Now that we removed the broken ransacker in previous commit,
we can allow Ransack v4.2 - with Rails 7.2 support - again.
We do not use the custom ransacker this was necessary for
@tvdeyen
Copy link
Member Author

tvdeyen commented Sep 12, 2024

Nice, thanks for addressing the root cause ❤️

Should be fixed by #5853

We need at least v3.7 of awesome_nested_set for Rails 7.2 support
Rails 7.2 requires it and 3.0 is out of support anyway.
@tvdeyen tvdeyen force-pushed the rails-7.2 branch 2 times, most recently from 329a769 to 6ac936c Compare September 12, 2024 09:37
Rails 7.2 removed migration_context from ActiveRecord::Base.connection
The file lives in tasks and the projects are in the root
folder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_admin changelog:solidus_api Changes to the solidus_api gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem changelog:solidus_sample Changes to the solidus_sample gem changelog:solidus Changes to the solidus meta-gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants