Sha256: 4a5d09805fc884d288a6e5c4de10cf1e9be286cf7f2182bcb9eda7ee2215734d
Contents?: true
Size: 563 Bytes
Versions: 25
Compression:
Stored size: 563 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 ||= ActiveSupport::JSON::decode(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
25 entries across 25 versions & 1 rubygems