friendlycart/solidus_friendly_promotions

Ransack scope missing

Closed this issue · 1 comments

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]

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