Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Ransack scope missing #105

Closed
mickenorlen opened this issue Apr 20, 2024 · 1 comment · Fixed by #106
Closed

Ransack scope missing #105

mickenorlen opened this issue Apr 20, 2024 · 1 comment · Fixed by #106

Comments

@mickenorlen
Copy link
Contributor

Creating a free shipping discount. And then running:

SolidusFriendlyPromotions::ShippingRateDiscount.first.promotion_action

Gives

*** NameError Exception: undefined local variable or method `with_discarded' for #<ActiveRecord::Relation [#<SolidusFriendlyPromotions::Actions::AdjustLineItem

Related to:

  class ShippingRateDiscount < Spree::Base
    ...
    belongs_to :promotion_action, -> { with_discarded }, inverse_of: false

Not sure if above should be removed or if the following line from promotion.rb should be integrated for promotion_action.rb as well.

    self.allowed_ransackable_scopes = %i[active with_discarded]
@mamhoff
Copy link
Contributor

mamhoff commented Apr 21, 2024

This has nothing to do with Ransack. When implementing #30 , I forgot to remove the with_discarded scope from that relation. Fixed in #106 .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants