Sha256: f350d164f97b67dcafd7a2ee48eb28a40fa8ff03d56b8c04460a46bf1a7c3a94
Contents?: true
Size: 439 Bytes
Versions: 7
Compression:
Stored size: 439 Bytes
Contents
class Cart < ApplicationRecord include DiscoApp::Concerns::Synchronises SHOPIFY_API_CLASS = ShopifyAPI::Cart belongs_to :shop, class_name: 'DiscoApp::Shop' before_save :set_token def self.synchronise_by(_shop, data) { token: data[:token] } end def total_price data[:line_items].map { |line_item| line_item[:line_price].to_f }.sum end private def set_token self.token = data[:token] end end
Version data entries
7 entries across 7 versions & 1 rubygems