Sha256: 02c2535ad977644792bb0df205108d3bbe5d7485785a3b021e71ad5435161547

Contents?: true

Size: 564 Bytes

Versions: 17

Compression:

Stored size: 564 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

17 entries across 17 versions & 1 rubygems

Version Path
disco_app-0.16.1.pre.sidekiq.pre.6.pre.release app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.13.3 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.13.4 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.13.5 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.13.6 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.13.7 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.13.8 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.14.1 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.14.2 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.15.0 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.16.0 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.14.4 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.14.3 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.16.1 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.15.2 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.14.0 app/jobs/disco_app/concerns/shop_update_job.rb
disco_app-0.13.6.pre.puma.pre.3 app/jobs/disco_app/concerns/shop_update_job.rb