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

Introduce allowed_ransackable_scopes #4956

Merged

Conversation

RyanofWoods
Copy link
Contributor

@RyanofWoods RyanofWoods commented Feb 27, 2023

Summary

Introduce allowed_ransackable_scopes to:

  • consistent with the other Ransackable methods we have declared; and
  • allow for easy concatenation of ransackable_scopes values already on Product and Promotion (by using allowed_ransackable_scopes).

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.

@RyanofWoods RyanofWoods requested a review from a team as a code owner February 27, 2023 06:09
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Feb 27, 2023
Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

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

Thanks, @RyanofWoods! Looks legit 🙂

@RyanofWoods RyanofWoods force-pushed the ryanofwoods/move-ransackable-scopes branch from ae1765d to 708794c Compare February 27, 2023 07:31
ransackable_scopes is currently declared on two models, although other
ransackable methods are declared through RansackableAttributes. By this
move, the codebase becomes more consistent.
By using allowed_ransackable_scopes which was introduced in the last
commit, stores will be able to easily concatenate to the arrays already
declared on Product and Promotion in Solidus.
@RyanofWoods RyanofWoods force-pushed the ryanofwoods/move-ransackable-scopes branch from 708794c to a68e768 Compare February 27, 2023 07:33
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thanks @RyanofWoods, this makes sense. I left a detective question 🕵️‍♂️, to better understand any possible backward compatibility issue.

core/app/models/spree/product.rb Show resolved Hide resolved
Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

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

Thanks!!!

@kennyadsl kennyadsl added the type:enhancement Proposed or newly added feature label Mar 2, 2023
@kennyadsl kennyadsl merged commit c09ead3 into solidusio:master Mar 2, 2023
@kennyadsl kennyadsl deleted the ryanofwoods/move-ransackable-scopes branch March 2, 2023 16:24
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 type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants