FIX: 500 error when editing a pricing plan (#94)

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....)
diff --git a/app/controllers/discourse_subscriptions/admin/plans_controller.rb b/app/controllers/discourse_subscriptions/admin/plans_controller.rb
index b66f648..e0024ff 100644
--- a/app/controllers/discourse_subscriptions/admin/plans_controller.rb
+++ b/app/controllers/discourse_subscriptions/admin/plans_controller.rb
@@ -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)
 

GitHub sha: 4f2af3b01ac87311688b58025506cd5f44f3a24b

This commit appears in #94 which was approved by CvX. It was merged by blake.