FIX: 500 error when editing a pricing plan (#94)
`.dig` isn't valid for stripe objects. This commit fixes this 500 error you get when trying to edit a pricing plan: ``` NoMethodError (undefined method `dig' for #<Stripe::Price:0x....) ```
This commit is contained in:
parent
e8621cf5d1
commit
4f2af3b01a
|
@ -55,7 +55,10 @@ module DiscourseSubscriptions
|
|||
trial_days = plan[:recurring][:trial_period_days]
|
||||
end
|
||||
|
||||
interval = plan.dig(:recurring, :interval)
|
||||
interval = nil
|
||||
if plan[:recurring] && plan[:recurring][:interval]
|
||||
interval = plan[:recurring][:interval]
|
||||
end
|
||||
|
||||
serialized = plan.to_h.merge(trial_period_days: trial_days, currency: plan[:currency].upcase, interval: interval)
|
||||
|
||||
|
|
Loading…
Reference in New Issue