Module: Spree::Api::Webhooks::VariantDecorator

Defined in:
app/models/spree/api/webhooks/variant_decorator.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
8
9
10
11
# File 'app/models/spree/api/webhooks/variant_decorator.rb', line 5

def self.prepended(base)
  def base.custom_webhook_events
    %w[variant.back_in_stock variant.backorderable variant.discontinued variant.out_of_stock]
  end

  base.after_update_commit :queue_webhooks_requests_for_variant_discontinued!
end