Sha256: 4f7b26bd19802488c5c2a5c7c1d95a90feaf66abb8e74a54b93c4f0deb02d003
Contents?: true
Size: 1.17 KB
Versions: 17
Compression:
Stored size: 1.17 KB
Contents
module DiscoApp::Concerns::AppInstalledJob extend ActiveSupport::Concern included do before_enqueue { @shop.awaiting_install! } before_perform { @shop.installing! } after_perform { @shop.installed! } end # Perform application installation. # # - Synchronise webhooks. # - Synchronise carrier service, if required. # - Perform initial update of shop information. # - Subscribe to default plan, if any exists. # def perform(_shop, plan_code = nil, source = nil) DiscoApp::SynchroniseWebhooksJob.perform_now(@shop) DiscoApp::SynchroniseCarrierServiceJob.perform_now(@shop) DiscoApp::ShopUpdateJob.perform_now(@shop) @shop.reload if default_plan.present? DiscoApp::SubscriptionService.subscribe(@shop, default_plan, plan_code, source) end end # Provide an overridable hook for applications to examine the @shop object # and return the default plan, if any, the shop should be subscribed to. If # nil is returned, no automatic subscription will take place and the store # owner will be forced to choose a plan after installation. # # If implementing this method, it should be memoized. def default_plan nil end end
Version data entries
17 entries across 17 versions & 1 rubygems