Sha256: a70afdb294cc70fca94baf032f8466a8a6b5c02f4ef2a8e99da05b4d2a0f5fae
Contents?: true
Size: 354 Bytes
Versions: 9
Compression:
Stored size: 354 Bytes
Contents
Spree::Order.class_eval do def self.build_from_api(user, params) order = create params[:line_items_attributes] ||= [] params[:line_items_attributes].each do |line_item| order.add_variant(Spree::Variant.find(line_item[:variant_id]), line_item[:quantity]) end order.user = user order.email = user.email order end end
Version data entries
9 entries across 9 versions & 2 rubygems