Module: Spree::Api::Webhooks::ShipmentDecorator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



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

def self.prepended(base)
  def base.custom_webhook_events
    %w[shipment.shipped]
  end
end

Instance Method Details

#after_shipObject



11
12
13
14
15
# File 'app/models/spree/api/webhooks/shipment_decorator.rb', line 11

def after_ship
  super
  queue_webhooks_requests!('shipment.shipped')
  order.queue_webhooks_requests!('order.shipped') if order.fully_shipped?
end