Sha256: 346239d96c6dd62fe3f19ef07be6c46f066367c5299941aa8a3e03f0e844ad49
Contents?: true
Size: 593 Bytes
Versions: 21
Compression:
Stored size: 593 Bytes
Contents
class AppUninstalledJob < ActiveJob::Base extend ShopifyAPI::Webhooks::Handler class << self def handle(topic:, shop:, body:) perform_later(topic: topic, shop_domain: shop, webhook: body) end end def perform(topic:, shop_domain:, webhook:) shop = Shop.find_by(shopify_domain: shop_domain) if shop.nil? logger.error("#{self.class} failed: cannot find shop with domain '#{shop_domain}'") raise ActiveRecord::RecordNotFound, "Shop Not Found" end logger.info("#{self.class} started for shop '#{shop_domain}'") shop.destroy end end
Version data entries
21 entries across 21 versions & 1 rubygems