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

Clean up Ransack query for promotion code #8

Merged
merged 1 commit into from
Dec 8, 2016

Conversation

stewart
Copy link

@stewart stewart commented Dec 6, 2016

This commit fixes up the ransack search when attempting to find Orders
via a promotion code, by using one fewer join in the resulting query and
going directly through the spree_orders_promotions table.

This commit exists upstream as solidusio#1662

This commit fixes up the ransack search when attempting to find Orders
via a promotion code, by using one fewer join in the resulting query and
going directly through the spree_orders_promotions table.

This commit exists upstream as a WIP from @jhawthorn:
solidusio@22ebde7
@stewart stewart force-pushed the fix/promotion_code_ransack branch from 85264f8 to 93ad772 Compare December 7, 2016 19:42
@@ -27,7 +27,7 @@ class CannotRebuildShipments < StandardError; end
go_to_state :confirm
end

self.whitelisted_ransackable_associations = %w[shipments user promotions bill_address ship_address line_items]
self.whitelisted_ransackable_associations = %w[shipments user order_promotions promotions bill_address ship_address line_items]

Choose a reason for hiding this comment

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

Do we want to keep promotions here? I guess for the separate Promo page's search?

Copy link
Author

Choose a reason for hiding this comment

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

The promotions association may still be useful in some contexts - I don't believe it's used in our application or in Solidus, but I'm hesitant to remove it unless it's also removed upstream first.

@adammathys adammathys merged commit 7cfb2ac into v1.2.2 Dec 8, 2016
@adammathys adammathys deleted the fix/promotion_code_ransack branch December 8, 2016 18:17
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.

3 participants