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

Enhance product model with variants_option_values ransacker #5395

Conversation

rainerdema
Copy link
Contributor

@rainerdema rainerdema commented Sep 27, 2023

Summary

This PR introduces a new ransacker, variants_option_values, to the Spree::Product model.

The primary purpose of this ransacker is to enhance filtering capabilities within the admin interface.
It facilitates combinate option type filtering with ransack, allowing for more refined searches based on variant option values.

  • Added a ransacker variants_option_values to enable searching based on product variants' option values.
  • Updated allowed_ransackable_attributes to include variants_option_values.

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.

@rainerdema rainerdema self-assigned this Sep 27, 2023
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Sep 27, 2023
@rainerdema rainerdema force-pushed the rainerd/feature/product-variant-option-values-ransacker branch 3 times, most recently from a81706a to 408a8b9 Compare September 27, 2023 15:18
@rainerdema rainerdema marked this pull request as ready for review September 27, 2023 15:27
@rainerdema rainerdema requested a review from a team as a code owner September 27, 2023 15:27
@rainerdema rainerdema requested a review from elia September 27, 2023 15:27
@elia elia added this to the 4.2 milestone Sep 28, 2023
core/app/models/spree/product.rb Show resolved Hide resolved
core/app/models/spree/product.rb Outdated Show resolved Hide resolved
@rainerdema rainerdema force-pushed the rainerd/feature/product-variant-option-values-ransacker branch 2 times, most recently from f9e1ddf to a223dd8 Compare September 28, 2023 14:46
@rainerdema rainerdema requested a review from elia September 28, 2023 14:46
@rainerdema rainerdema force-pushed the rainerd/feature/product-variant-option-values-ransacker branch from a223dd8 to a020947 Compare September 28, 2023 15:17
Introduce a ransacker `variants_option_values` on Spree::Product.
This ransacker enables dynamic filtering combined with ransack on
product variants option values.
For now, this attribute is geared towards usage in the admin interface.

https://activerecord-hackery.github.io/ransack/going-further/ransackers/
@rainerdema rainerdema force-pushed the rainerd/feature/product-variant-option-values-ransacker branch from a020947 to 0c66e14 Compare September 28, 2023 17:33
@elia elia merged commit e4ae444 into solidusio:main Sep 29, 2023
2 checks passed
@elia elia deleted the rainerd/feature/product-variant-option-values-ransacker branch September 29, 2023 07:46
@tvdeyen tvdeyen mentioned this pull request Sep 12, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants