summaryrefslogtreecommitdiff
path: root/lib/solidus_subscriptions/processor.rb
diff options
context:
space:
mode:
authorAlessandro Desantis <desa.alessandro@gmail.com>2020-09-24 14:23:54 +0200
committerAlessandro Desantis <desa.alessandro@gmail.com>2020-09-25 11:52:52 +0200
commita98ab3aeefca1b679376b6e05b91f5a516f8d802 (patch)
tree74312a78db6d2948d9d6129c9823c82195ea9072 /lib/solidus_subscriptions/processor.rb
parentc2ff76ed6f1b9aa377f566d7d98e743446919c0a (diff)
Fix coding style violations
Diffstat (limited to 'lib/solidus_subscriptions/processor.rb')
-rw-r--r--lib/solidus_subscriptions/processor.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/solidus_subscriptions/processor.rb b/lib/solidus_subscriptions/processor.rb
index be8a2f5..817d957 100644
--- a/lib/solidus_subscriptions/processor.rb
+++ b/lib/solidus_subscriptions/processor.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This class is responsible for finding subscriptions and installments
# which need to be processed. It will group them together by user and attempts
# to process them together. Subscriptions will also be grouped by their
@@ -61,7 +63,7 @@ module SolidusSubscriptions
[i.subscription.shipping_address_id, i.subscription.billing_address_id]
end
- installemts_by_address_and_user.values.each do |grouped_installments|
+ installemts_by_address_and_user.each_value do |grouped_installments|
ProcessInstallmentsJob.perform_later grouped_installments.map(&:id)
end
end
@@ -71,18 +73,18 @@ module SolidusSubscriptions
def subscriptions_by_id
@subscriptions_by_id ||= Subscription.
- actionable.
- includes(:line_items, :user).
- where(user_id: user_ids).
- group_by(&:user_id)
+ actionable.
+ includes(:line_items, :user).
+ where(user_id: user_ids).
+ group_by(&:user_id)
end
def retry_installments
@failed_installments ||= Installment.
- actionable.
- includes(:subscription).
- where(solidus_subscriptions_subscriptions: { user_id: user_ids }).
- group_by { |i| i.subscription.user_id }
+ actionable.
+ includes(:subscription).
+ where(solidus_subscriptions_subscriptions: { user_id: user_ids }).
+ group_by { |i| i.subscription.user_id }
end
def installments(user)