Skip to content

Commit

Permalink
Allow destroying nested line items
Browse files Browse the repository at this point in the history
When we’re updating a subscription, we may want to remove line items as well as modifying them.
  • Loading branch information
Isaac Freeman committed Jun 15, 2017
1 parent 0c5e587 commit 9acb661
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/solidus_subscriptions/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Subscription < ActiveRecord::Base
validates :user, presence: :true
validates :skip_count, :successive_skip_count, presence: true, numericality: { greater_than_or_equal_to: 0 }

accepts_nested_attributes_for :line_items, :shipping_address
accepts_nested_attributes_for :shipping_address
accepts_nested_attributes_for :line_items, allow_destroy: true

# The following methods are delegated to the associated
# SolidusSubscriptions::LineItem
Expand Down

0 comments on commit 9acb661

Please sign in to comment.