From 4830468e325ac917281ff8c8de8556188eda1d56 Mon Sep 17 00:00:00 2001 From: Justin DiRose Date: Tue, 9 Jun 2020 12:37:46 -0500 Subject: [PATCH] DEV: Fixes for rubocop --- app/controllers/user/payments_controller.rb | 2 +- spec/requests/user/payments_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/user/payments_controller.rb b/app/controllers/user/payments_controller.rb index 75c90a2..95b7688 100644 --- a/app/controllers/user/payments_controller.rb +++ b/app/controllers/user/payments_controller.rb @@ -19,7 +19,7 @@ module DiscourseSubscriptions customer_ids.each do |customer_id| # lots of matching because the Stripe API doesn't make it easy to match products => payments except from invoices all_invoices = ::Stripe::Invoice.list(customer: customer_id) - invoices_with_products = all_invoices[:data].select do |invoice| + invoices_with_products = all_invoices[:data].select do |invoice| # i cannot dig it so we must get iffy with it if invoice[:lines] && invoice[:lines][:data] && invoice[:lines][:data][0] && invoice[:lines][:data][0][:plan] && invoice[:lines][:data][0][:plan][:product] product_ids.include?(invoice[:lines][:data][0][:plan][:product]) diff --git a/spec/requests/user/payments_controller_spec.rb b/spec/requests/user/payments_controller_spec.rb index 5bb95ab..e67cfd2 100644 --- a/spec/requests/user/payments_controller_spec.rb +++ b/spec/requests/user/payments_controller_spec.rb @@ -45,11 +45,11 @@ module DiscourseSubscriptions customer: 'c_345678', ).returns( data: [ - { + { invoice: "inv_900007", created: Time.now }, - { + { invoice: "inv_007", created: Time.now }