Module: SolidusSubscriptions::Spree::User::HaveManySubscriptions

Defined in:
app/decorators/models/solidus_subscriptions/spree/user/have_many_subscriptions.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object


6
7
8
9
10
11
12
13
14
# File 'app/decorators/models/solidus_subscriptions/spree/user/have_many_subscriptions.rb', line 6

def self.prepended(base)
  base.has_many(
    :subscriptions,
    class_name: 'SolidusSubscriptions::Subscription',
    foreign_key: 'user_id'
  )

  base.accepts_nested_attributes_for :subscriptions
end