Class: SolidusFriendlyPromotions::Conditions::ShippingMethod
Instance Method Summary
collapse
#level
#eligibility_errors, #level, #preload_relations, #to_partial_path, #updateable?
Instance Method Details
#applicable?(promotable) ⇒ Boolean
10
11
12
|
# File 'app/models/solidus_friendly_promotions/conditions/shipping_method.rb', line 10
def applicable?(promotable)
promotable.is_a?(Spree::Shipment) || promotable.is_a?(Spree::ShippingRate)
end
|
#eligible?(promotable) ⇒ Boolean
14
15
16
|
# File 'app/models/solidus_friendly_promotions/conditions/shipping_method.rb', line 14
def eligible?(promotable)
promotable.shipping_method&.id&.in?(preferred_shipping_method_ids.map(&:to_i))
end
|