Sha256: afa7d3fd74fd08b157cba101d61c9321cf9b335cbf84cd3a7ed084f16e46edd2
Contents?: true
Size: 796 Bytes
Versions: 7
Compression:
Stored size: 796 Bytes
Contents
# frozen_string_literal: true # Each Spree::LineItem can have multiple subscription_line_items. This # allows a cart to represent multiple subscriptions to the same item in # the same order. module SolidusSubscriptions module Spree module LineItem module SubscriptionLineItemsAssociation def self.prepended(base) base.has_many( :subscription_line_items, class_name: 'SolidusSubscriptions::LineItem', foreign_key: :spree_line_item_id, inverse_of: :spree_line_item, dependent: :destroy ) base.accepts_nested_attributes_for :subscription_line_items end end end end end Spree::LineItem.prepend(SolidusSubscriptions::Spree::LineItem::SubscriptionLineItemsAssociation)
Version data entries
7 entries across 7 versions & 1 rubygems