From e3e5a7d4b24b64f1e05bc4578c7f4c4fbc5871a2 Mon Sep 17 00:00:00 2001 From: Brendan Deere Date: Thu, 22 Dec 2016 09:56:48 -0800 Subject: Subs have many subs line items We are going to support multiple items per subscription. This commit changes the subscription -> subscription_line_item relationship from a has_one to a has_many. Most of the changes here are simply pluralization changes. Somethat are not: Api params now take: `line_items_attributes instead` of `line_item_attributes` for nested params to a subscription `subscription_line_items_attributes` instead of `subscription_line_item_attributes` Only the interval of the first subscription_line_item is considered --- lib/solidus_subscriptions/permitted_attributes.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/solidus_subscriptions/permitted_attributes.rb') diff --git a/lib/solidus_subscriptions/permitted_attributes.rb b/lib/solidus_subscriptions/permitted_attributes.rb index ce8ad75..2f50414 100644 --- a/lib/solidus_subscriptions/permitted_attributes.rb +++ b/lib/solidus_subscriptions/permitted_attributes.rb @@ -17,12 +17,12 @@ module SolidusSubscriptions end def subscription_line_item_attributes - Config.subscription_line_item_attributes + [Config.subscription_line_item_attributes] end def subscription_attributes Config.subscription_attributes | [ - { line_item_attributes: nested(subscription_line_item_attributes) - [:subscribable_id] } + { line_items_attributes: nested(subscription_line_item_attributes) - [:subscribable_id] } ] end -- cgit v1.2.3