diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 98e6cfc166..2713d9b86d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 1400` -# on 2020-11-05 11:27:59 +0000 using RuboCop version 0.81.0. +# on 2020-12-23 22:07:55 +0000 using RuboCop version 0.81.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -11,21 +11,19 @@ Lint/DuplicateMethods: Exclude: - 'lib/discourse/single_sign_on.rb' -# Offense count: 8 +# Offense count: 5 Lint/IneffectiveAccessModifier: Exclude: - 'app/models/column_preference.rb' - 'app/models/spree/user.rb' - 'app/services/mail_configuration.rb' - - 'lib/open_food_network/feature_toggle.rb' -# Offense count: 3 +# Offense count: 2 # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods. Lint/UselessAccessModifier: Exclude: - 'app/models/column_preference.rb' - 'app/services/mail_configuration.rb' - - 'lib/open_food_network/feature_toggle.rb' # Offense count: 10 Naming/AccessorMethodName: @@ -88,12 +86,13 @@ Naming/VariableNumber: Exclude: - 'spec/factories/stock_location_factory.rb' -# Offense count: 7 +# Offense count: 8 # Cop supports --auto-correct. Rails/ActiveRecordAliases: Exclude: - 'spec/controllers/line_items_controller_spec.rb' - 'spec/controllers/spree/orders_controller_spec.rb' + - 'spec/features/admin/subscriptions_spec.rb' - 'spec/features/consumer/shopping/orders_spec.rb' - 'spec/requests/api/orders_spec.rb' @@ -267,7 +266,7 @@ Rails/ReflectionClassName: - 'app/models/spree/order.rb' - 'app/models/subscription.rb' -# Offense count: 250 +# Offense count: 252 # Configuration parameters: Blacklist, Whitelist. # Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters Rails/SkipsModelValidations: @@ -276,6 +275,7 @@ Rails/SkipsModelValidations: - 'app/controllers/spree/admin/payment_methods_controller.rb' - 'app/controllers/spree/admin/shipping_methods_controller.rb' - 'app/controllers/spree/admin/taxons_controller.rb' + - 'app/controllers/spree/credit_cards_controller.rb' - 'app/controllers/spree/orders_controller.rb' - 'app/jobs/subscription_confirm_job.rb' - 'app/jobs/subscription_placement_job.rb' @@ -437,7 +437,7 @@ Style/FormatStringToken: - 'lib/open_food_network/sales_tax_report.rb' - 'spec/features/admin/bulk_order_management_spec.rb' -# Offense count: 760 +# Offense count: 365 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never @@ -483,7 +483,6 @@ Style/FrozenStringLiteralComment: - 'app/controllers/api/taxonomies_controller.rb' - 'app/controllers/api/taxons_controller.rb' - 'app/controllers/api/variants_controller.rb' - - 'app/controllers/application_controller.rb' - 'app/controllers/base_controller.rb' - 'app/controllers/cart_controller.rb' - 'app/controllers/discourse_sso_controller.rb' @@ -547,7 +546,6 @@ Style/FrozenStringLiteralComment: - 'app/helpers/enterprises_helper.rb' - 'app/helpers/footer_links_helper.rb' - 'app/helpers/groups_helper.rb' - - 'app/helpers/html_helper.rb' - 'app/helpers/i18n_helper.rb' - 'app/helpers/injection_helper.rb' - 'app/helpers/map_helper.rb' @@ -566,14 +564,10 @@ Style/FrozenStringLiteralComment: - 'app/helpers/spree/orders_helper.rb' - 'app/helpers/spree/reports_helper.rb' - 'app/helpers/spree_currency_helper.rb' - - 'app/jobs/confirm_order_job.rb' - - 'app/jobs/confirm_signup_job.rb' - 'app/jobs/heartbeat_job.rb' - 'app/jobs/manager_invitation_job.rb' - - 'app/jobs/order_cycle_notification_job.rb' - 'app/jobs/subscription_confirm_job.rb' - 'app/jobs/subscription_placement_job.rb' - - 'app/jobs/welcome_enterprise_job.rb' - 'app/mailers/enterprise_mailer.rb' - 'app/mailers/spree/user_mailer.rb' - 'app/mailers/subscription_mailer.rb' @@ -595,7 +589,6 @@ Style/FrozenStringLiteralComment: - 'app/models/distributor_shipping_method.rb' - 'app/models/enterprise_fee.rb' - 'app/models/enterprise_fee_set.rb' - - 'app/models/enterprise_group.rb' - 'app/models/enterprise_relationship_permission.rb' - 'app/models/enterprise_role.rb' - 'app/models/enterprise_set.rb' @@ -756,7 +749,6 @@ Style/FrozenStringLiteralComment: - 'lib/open_food_network/group_buy_report.rb' - 'lib/open_food_network/i18n_config.rb' - 'lib/open_food_network/lettuce_share_report.rb' - - 'lib/open_food_network/locking.rb' - 'lib/open_food_network/order_and_distributor_report.rb' - 'lib/open_food_network/order_cycle_form_applicator.rb' - 'lib/open_food_network/order_cycle_management_report.rb' @@ -771,7 +763,6 @@ Style/FrozenStringLiteralComment: - 'lib/open_food_network/packing_report.rb' - 'lib/open_food_network/paperclippable.rb' - 'lib/open_food_network/payments_report.rb' - - 'lib/open_food_network/permalink_generator.rb' - 'lib/open_food_network/permissions.rb' - 'lib/open_food_network/products_and_inventory_report.rb' - 'lib/open_food_network/products_and_inventory_report_base.rb' @@ -791,7 +782,6 @@ Style/FrozenStringLiteralComment: - 'lib/open_food_network/xero_invoices_report.rb' - 'lib/spree/api/controller_setup.rb' - 'lib/spree/authentication_helpers.rb' - - 'lib/spree/localized_number.rb' - 'lib/spree/money_decorator.rb' - 'lib/stripe/account_connector.rb' - 'lib/stripe/profile_storer.rb' @@ -828,7 +818,6 @@ Style/GuardClause: - 'app/controllers/admin/product_import_controller.rb' - 'app/controllers/api/shipments_controller.rb' - 'app/controllers/application_controller.rb' - - 'app/controllers/checkout_controller.rb' - 'app/controllers/home_controller.rb' - 'app/controllers/spree/orders_controller.rb' - 'app/controllers/spree/paypal_controller_decorator.rb' @@ -841,6 +830,7 @@ Style/GuardClause: - 'lib/discourse/single_sign_on.rb' - 'lib/open_food_network/order_cycle_form_applicator.rb' - 'lib/open_food_network/rack_request_blocker.rb' + - 'lib/spree/core/controller_helpers/respond_with.rb' - 'spec/support/delayed_job_helper.rb' - 'spec/support/request/distribution_helper.rb' - 'spec/support/request/shop_workflow.rb' @@ -858,7 +848,7 @@ Style/MixinUsage: - 'lib/open_food_network/orders_and_fulfillments_report.rb' - 'spec/lib/open_food_network/packing_report_spec.rb' -# Offense count: 43 +# Offense count: 42 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. # SupportedStyles: predicate, comparison @@ -889,7 +879,7 @@ Style/NumericPredicate: - 'lib/spree/money_decorator.rb' - 'lib/tasks/sample_data.rake' -# Offense count: 241 +# Offense count: 243 Style/Send: Exclude: - 'spec/controllers/admin/subscriptions_controller_spec.rb' diff --git a/app/controllers/spree/paypal_controller_decorator.rb b/app/controllers/spree/paypal_controller_decorator.rb index 71d559590a..b301339b81 100644 --- a/app/controllers/spree/paypal_controller_decorator.rb +++ b/app/controllers/spree/paypal_controller_decorator.rb @@ -63,14 +63,18 @@ Spree::PaypalController.class_eval do # last chance to interact with the payment process before the money moves... return reset_to_cart unless sufficient_stock? - @order.payments.create!({ - source: Spree::PaypalExpressCheckout.create({ - token: params[:token], - payer_id: params[:PayerID] - }), - amount: @order.total, - payment_method: payment_method - }) + @order.payments.create!( + { + source: Spree::PaypalExpressCheckout.create( + { + token: params[:token], + payer_id: params[:PayerID] + } + ), + amount: @order.total, + payment_method: payment_method + } + ) @order.next if @order.complete? flash.notice = Spree.t(:order_processed_successfully)