Module: SolidusSubscriptions::Spree::LineItem::SubscriptionLineItemsAssociation

Defined in:
app/decorators/models/solidus_subscriptions/spree/line_item/subscription_line_items_association.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'app/decorators/models/solidus_subscriptions/spree/line_item/subscription_line_items_association.rb', line 10

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