Sha256: 0a06670c0a5e688bcd0720ca86bc9e5aeb3e4465498dff277d621aedb7ff43ad
Contents?: true
Size: 596 Bytes
Versions: 7
Compression:
Stored size: 596 Bytes
Contents
module DiscoApp::Concerns::ShopUpdateJob extend ActiveSupport::Concern # Perform an update of the current shop's information. def perform(_shop, shop_data = nil) # If we weren't provided with shop data (eg from a webhook), fetch it. shop_data ||= JSON.parse(ShopifyAPI::Shop.current.to_json) # Update attributes stored directly on the Shop model, along with the data hash itself. @shop.update( shop_data .with_indifferent_access .slice(*DiscoApp::Shop.column_names) .except(:id, :created_at) .merge(data: shop_data) ) end end
Version data entries
7 entries across 7 versions & 1 rubygems