From e52937c1134949eaf0a5201bd619bc731252379f Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 17 Jun 2021 23:07:26 +0100 Subject: [PATCH] Use rubocop auto correct to add frozen string literal to all files This is an unsafe auto corection, we will need to trust our build here --- .rubocop_todo.yml | 343 ------------------ .simplecov | 1 + .../admin/bulk_line_items_controller.rb | 2 + .../admin/column_preferences_controller.rb | 2 + app/controllers/admin/contents_controller.rb | 2 + app/controllers/admin/customers_controller.rb | 2 + .../admin/enterprise_fees_controller.rb | 2 + .../admin/enterprise_groups_controller.rb | 2 + .../enterprise_relationships_controller.rb | 2 + .../admin/enterprise_roles_controller.rb | 2 + .../admin/enterprises_controller.rb | 2 + .../admin/inventory_items_controller.rb | 2 + .../admin/invoice_settings_controller.rb | 2 + .../admin/manager_invitations_controller.rb | 2 + .../admin/matomo_settings_controller.rb | 2 + .../admin/order_cycles_controller.rb | 2 + .../admin/producer_properties_controller.rb | 2 + .../admin/product_import_controller.rb | 2 + .../admin/proxy_orders_controller.rb | 2 + app/controllers/admin/resource_controller.rb | 2 + app/controllers/admin/schedules_controller.rb | 2 + .../admin/stripe_accounts_controller.rb | 2 + .../stripe_connect_settings_controller.rb | 2 + .../subscription_line_items_controller.rb | 2 + .../admin/subscriptions_controller.rb | 2 + app/controllers/admin/tag_rules_controller.rb | 2 + .../admin/variant_overrides_controller.rb | 2 + app/controllers/api/v0/taxons_controller.rb | 2 + app/controllers/cart_controller.rb | 2 + app/controllers/discourse_sso_controller.rb | 2 + app/controllers/enterprises_controller.rb | 2 + app/controllers/groups_controller.rb | 2 + app/controllers/home_controller.rb | 2 + app/controllers/line_items_controller.rb | 2 + app/controllers/map_controller.rb | 2 + app/controllers/metal_decorator.rb | 2 + app/controllers/producers_controller.rb | 2 + app/controllers/registration_controller.rb | 2 + app/controllers/shop_controller.rb | 2 + app/controllers/shops_controller.rb | 2 + app/controllers/sitemap_controller.rb | 2 + .../spree/admin/adjustments_controller.rb | 2 + .../spree/admin/base_controller.rb | 2 + .../spree/admin/countries_controller.rb | 2 + .../admin/general_settings_controller.rb | 2 + .../spree/admin/images_controller.rb | 2 + .../spree/admin/invoices_controller.rb | 2 + .../spree/admin/mail_methods_controller.rb | 2 + .../orders/customer_details_controller.rb | 2 + .../spree/admin/orders_controller.rb | 2 + .../spree/admin/overview_controller.rb | 2 + .../spree/admin/payment_methods_controller.rb | 2 + .../admin/product_properties_controller.rb | 2 + .../spree/admin/products_controller.rb | 2 + .../spree/admin/properties_controller.rb | 2 + .../spree/admin/reports_controller.rb | 2 + .../admin/return_authorizations_controller.rb | 2 + .../spree/admin/search_controller.rb | 2 + .../admin/shipping_categories_controller.rb | 2 + .../admin/shipping_methods_controller.rb | 2 + .../spree/admin/states_controller.rb | 2 + .../spree/admin/tax_categories_controller.rb | 2 + .../spree/admin/tax_rates_controller.rb | 2 + .../spree/admin/tax_settings_controller.rb | 2 + .../spree/admin/taxonomies_controller.rb | 2 + .../spree/admin/taxons_controller.rb | 2 + .../spree/admin/users_controller.rb | 2 + .../spree/admin/variants_controller.rb | 2 + .../spree/admin/zones_controller.rb | 2 + app/controllers/spree/orders_controller.rb | 2 + app/controllers/spree/users_controller.rb | 2 + .../stripe/callbacks_controller.rb | 2 + app/controllers/stripe/webhooks_controller.rb | 2 + .../user_confirmations_controller.rb | 2 + app/controllers/user_passwords_controller.rb | 2 + .../user_registrations_controller.rb | 4 +- app/helpers/admin/enterprises_helper.rb | 2 + app/helpers/admin/injection_helper.rb | 2 + app/helpers/admin/orders_helper.rb | 2 + app/helpers/admin/subscriptions_helper.rb | 2 + app/helpers/angular_form_builder.rb | 2 + app/helpers/angular_form_helper.rb | 2 + app/helpers/application_helper.rb | 2 + app/helpers/checkout_helper.rb | 2 + app/helpers/discourse_helper.rb | 2 + app/helpers/enterprise_fees_helper.rb | 2 + app/helpers/enterprises_helper.rb | 2 + app/helpers/footer_links_helper.rb | 2 + app/helpers/groups_helper.rb | 2 + app/helpers/i18n_helper.rb | 2 + app/helpers/injection_helper.rb | 2 + app/helpers/map_helper.rb | 2 + app/helpers/markdown_helper.rb | 2 + app/helpers/serializer_helper.rb | 2 + app/helpers/shared_helper.rb | 2 + app/helpers/shop_helper.rb | 2 + app/helpers/shop_mail_helper.rb | 2 + app/helpers/spree/admin/base_helper.rb | 2 + .../spree/admin/general_settings_helper.rb | 2 + app/helpers/spree/admin/orders_helper.rb | 2 + app/helpers/spree/admin/taxons_helper.rb | 2 + app/helpers/spree/admin/zones_helper.rb | 2 + app/helpers/spree/orders_helper.rb | 2 + app/helpers/spree/payment_methods_helper.rb | 2 + app/helpers/spree/reports_helper.rb | 2 + app/helpers/spree_currency_helper.rb | 2 + app/jobs/subscription_confirm_job.rb | 2 + app/jobs/subscription_placement_job.rb | 2 + app/mailers/enterprise_mailer.rb | 2 + app/mailers/spree/user_mailer.rb | 2 + app/mailers/subscription_mailer.rb | 2 + app/models/adjustment_metadata.rb | 2 + .../calculator/flat_percent_per_item.rb | 2 + app/models/calculator/weight.rb | 2 + app/models/column_preference.rb | 2 + app/models/concerns/address_display.rb | 2 + app/models/concerns/adjustment_scopes.rb | 2 + app/models/concerns/order_shipment.rb | 2 + app/models/concerns/product_stock.rb | 2 + .../stock_settings_override_validation.rb | 2 + app/models/concerns/variant_stock.rb | 2 + app/models/content_configuration.rb | 2 + app/models/coordinator_fee.rb | 2 + app/models/customer.rb | 2 + app/models/distributor_shipping_method.rb | 2 + app/models/enterprise_fee.rb | 2 + .../enterprise_relationship_permission.rb | 2 + app/models/enterprise_role.rb | 2 + app/models/exchange.rb | 2 + app/models/exchange_fee.rb | 2 + app/models/exchange_variant.rb | 2 + app/models/inventory_item.rb | 2 + app/models/order_cycle.rb | 2 + .../footer_and_external_links_section.rb | 2 + .../group_signup_page_section.rb | 2 + .../preference_sections/header_section.rb | 2 + .../preference_sections/home_page_section.rb | 2 + .../hub_signup_page_section.rb | 2 + .../preference_sections/main_links_section.rb | 2 + .../producer_signup_page_section.rb | 2 + .../preference_sections/user_guide_section.rb | 2 + app/models/producer_property.rb | 2 + app/models/product_import/entry_processor.rb | 2 + app/models/product_import/entry_validator.rb | 2 + .../inventory_reset_strategy.rb | 2 + app/models/product_import/product_importer.rb | 2 + app/models/product_import/reset_absent.rb | 2 + app/models/product_import/settings.rb | 2 + app/models/product_import/spreadsheet_data.rb | 2 + .../product_import/spreadsheet_entry.rb | 2 + app/models/product_import/unit_converter.rb | 2 + app/models/proxy_order.rb | 2 + app/models/schedule.rb | 2 + app/models/spree/gateway/stripe_connect.rb | 2 + .../spree/preferences/file_configuration.rb | 2 + app/models/spree/property.rb | 2 + app/models/spree/user.rb | 2 + app/models/stripe_account.rb | 2 + app/models/subscription.rb | 2 + app/models/subscription_line_item.rb | 2 + app/models/tag_rule.rb | 2 + app/models/tag_rule/filter_order_cycles.rb | 2 + app/models/tag_rule/filter_payment_methods.rb | 2 + app/models/tag_rule/filter_products.rb | 2 + .../tag_rule/filter_shipping_methods.rb | 2 + app/serializers/api/address_serializer.rb | 2 + app/serializers/api/adjustment_serializer.rb | 2 + .../api/cached_enterprise_serializer.rb | 2 + app/serializers/api/country_serializer.rb | 2 + app/serializers/api/credit_card_serializer.rb | 2 + .../api/currency_config_serializer.rb | 2 + .../api/current_order_serializer.rb | 2 + app/serializers/api/customer_serializer.rb | 2 + app/serializers/api/enterprise_serializer.rb | 2 + .../enterprise_shopfront_list_serializer.rb | 2 + .../api/enterprise_shopfront_serializer.rb | 2 + .../api/enterprise_thin_serializer.rb | 2 + app/serializers/api/group_list_serializer.rb | 2 + app/serializers/api/id_name_serializer.rb | 2 + app/serializers/api/id_serializer.rb | 2 + app/serializers/api/image_serializer.rb | 2 + app/serializers/api/line_item_serializer.rb | 2 + app/serializers/api/order_cycle_serializer.rb | 2 + .../api/order_detailed_serializer.rb | 2 + app/serializers/api/order_serializer.rb | 2 + .../api/payment_method_serializer.rb | 2 + app/serializers/api/payment_serializer.rb | 2 + app/serializers/api/product_serializer.rb | 2 + app/serializers/api/property_serializer.rb | 2 + app/serializers/api/rails_flash_serializer.rb | 2 + app/serializers/api/shipment_serializer.rb | 2 + .../api/shipping_method_serializer.rb | 2 + .../api/shop_for_orders_serializer.rb | 2 + app/serializers/api/state_serializer.rb | 2 + .../api/taxon_jstree_attribute_serializer.rb | 2 + .../api/taxon_jstree_serializer.rb | 2 + app/serializers/api/taxon_serializer.rb | 2 + .../api/uncached_enterprise_serializer.rb | 2 + app/serializers/api/user_serializer.rb | 2 + app/serializers/api/variant_serializer.rb | 2 + app/services/bulk_invoice_service.rb | 2 + app/services/cart_service.rb | 2 + app/services/create_order_cycle.rb | 2 + app/services/current_order_locker.rb | 2 + app/services/default_country.rb | 2 + app/services/default_shipping_category.rb | 4 +- app/services/default_stock_location.rb | 4 +- app/services/embedded_page_service.rb | 2 + app/services/exchange_variant_bulk_updater.rb | 2 + app/services/exchange_variant_deleter.rb | 2 + app/services/invoice_renderer.rb | 2 + app/services/line_item_syncer.rb | 2 + app/services/mail_configuration.rb | 2 + app/services/order_adjustments_fetcher.rb | 2 + .../order_cycle_distributed_products.rb | 2 + .../order_cycle_distributed_variants.rb | 2 + app/services/order_cycle_form.rb | 2 + app/services/order_factory.rb | 2 + app/services/order_syncer.rb | 2 + app/services/order_update_issues.rb | 2 + app/services/order_workflow.rb | 2 + app/services/permissions/order.rb | 2 + app/services/product_tag_rules_filterer.rb | 2 + app/services/products_renderer.rb | 2 + app/services/search_orders.rb | 2 + app/services/tax_rate_finder.rb | 2 + app/services/terms_of_service.rb | 2 + app/services/upload_sanitizer.rb | 2 + app/services/variant_deleter.rb | 2 + .../variant_and_line_item_naming.rb | 2 + app/services/variants_stock_levels.rb | 2 + app/validators/date_time_string_validator.rb | 2 + app/validators/distributors_validator.rb | 2 + app/validators/integer_array_validator.rb | 2 + .../application_controller.rb | 2 + .../enterprise_fee_summary/authorizer.rb | 2 + .../data_representations/coordinator_fee.rb | 2 + .../exchange_order_fee.rb | 2 + .../incoming_exchange_line_item_fee.rb | 2 + .../outgoing_exchange_line_item_fee.rb | 2 + .../payment_method_fee.rb | 2 + .../shipping_method_fee.rb | 2 + .../using_enterprise_fee.rb | 2 + .../data_representations/with_i18n.rb | 2 + .../enterprise_fee_summary/parameters.rb | 2 + .../enterprise_fee_summary/permissions.rb | 2 + .../renderers/csv_renderer.rb | 2 + .../renderers/html_renderer.rb | 2 + .../report_data/enterprise_fee_type_total.rb | 2 + .../enterprise_fee_summary/report_service.rb | 2 + .../reports/enterprise_fee_summary/scope.rb | 2 + .../enterprise_fee_summary/summarizer.rb | 2 + .../order_management/app/services/reports.rb | 2 + .../app/services/reports/authorizer.rb | 2 + .../app/services/reports/parameters/base.rb | 2 + .../app/services/reports/permissions.rb | 2 + .../app/services/reports/renderers/base.rb | 2 + .../app/services/reports/report_data/base.rb | 2 + .../web/angular_templates_controller.rb | 2 + .../controllers/web/application_controller.rb | 2 + .../app/helpers/web/cookies_policy_helper.rb | 2 + engines/web/lib/web/cookies_consent.rb | 4 +- lib/discourse/single_sign_on.rb | 2 + lib/open_food_network/address_finder.rb | 2 + .../available_payment_method_filter.rb | 2 + .../column_preference_defaults.rb | 2 + lib/open_food_network/customers_report.rb | 2 + .../enterprise_fee_applicator.rb | 2 + .../enterprise_fee_calculator.rb | 2 + .../enterprise_injection_data.rb | 2 + .../enterprise_issue_validator.rb | 2 + lib/open_food_network/error_logger.rb | 2 + lib/open_food_network/feature_toggle.rb | 2 + lib/open_food_network/group_buy_report.rb | 2 + lib/open_food_network/i18n_config.rb | 2 + lib/open_food_network/lettuce_share_report.rb | 2 + .../order_and_distributor_report.rb | 2 + .../order_cycle_form_applicator.rb | 2 + lib/open_food_network/order_grouper.rb | 2 + .../orders_and_fulfillments_report.rb | 2 + .../customer_totals_report.rb | 4 +- .../default_report.rb | 2 + .../distributor_totals_by_supplier_report.rb | 4 +- .../supplier_totals_by_distributor_report.rb | 4 +- .../supplier_totals_report.rb | 4 +- lib/open_food_network/packing_report.rb | 2 + lib/open_food_network/paperclippable.rb | 2 + lib/open_food_network/permissions.rb | 2 + .../products_and_inventory_report.rb | 2 + .../products_and_inventory_report_base.rb | 2 + lib/open_food_network/property_merge.rb | 2 + lib/open_food_network/referer_parser.rb | 2 + lib/open_food_network/reports/line_items.rb | 2 + lib/open_food_network/reports/list.rb | 2 + lib/open_food_network/sales_tax_report.rb | 2 + lib/open_food_network/scope_product_to_hub.rb | 2 + lib/open_food_network/scope_variant_to_hub.rb | 2 + .../scope_variants_for_search.rb | 2 + lib/open_food_network/spree_api_key_loader.rb | 2 + lib/open_food_network/tag_rule_applicator.rb | 2 + .../users_and_enterprises_report.rb | 2 + lib/open_food_network/xero_invoices_report.rb | 2 + lib/spree/authentication_helpers.rb | 2 + lib/stripe/account_connector.rb | 2 + lib/stripe/profile_storer.rb | 2 + lib/stripe/webhook_handler.rb | 2 + lib/tasks/data.rake | 2 + lib/tasks/data/anonymize_data.rake | 2 + lib/tasks/enterprises.rake | 2 + lib/tasks/karma.rake | 2 + lib/tasks/missing_payments.rake | 2 + lib/tasks/sample_data.rake | 2 + lib/tasks/sample_data/addressing.rb | 2 + lib/tasks/sample_data/customer_factory.rb | 2 + lib/tasks/sample_data/enterprise_factory.rb | 2 + lib/tasks/sample_data/fee_factory.rb | 2 + lib/tasks/sample_data/group_factory.rb | 2 + lib/tasks/sample_data/inventory_factory.rb | 2 + lib/tasks/sample_data/logging.rb | 2 + lib/tasks/sample_data/order_cycle_factory.rb | 2 + .../sample_data/payment_method_factory.rb | 2 + lib/tasks/sample_data/permission_factory.rb | 2 + lib/tasks/sample_data/product_factory.rb | 2 + .../sample_data/shipping_method_factory.rb | 2 + lib/tasks/sample_data/taxon_factory.rb | 2 + lib/tasks/sample_data/user_factory.rb | 2 + lib/tasks/specs.rake | 2 + lib/tasks/users.rake | 2 + .../distributor_title_component_spec.rb | 2 + spec/components/example_component_spec.rb | 2 + .../distributor_title_component_stories.rb | 2 + .../stories/example_component_stories.rb | 2 + .../consumer/shopping/unit_price_spec.rb | 2 + .../terms_and_conditions_helper_spec.rb | 2 + .../reports/line_items_spec.rb | 2 + spec/models/concerns/balance_spec.rb | 2 + spec/services/order_data_masker_spec.rb | 2 + 337 files changed, 679 insertions(+), 351 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 61b7c72f9d..3d5daf5f69 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -599,349 +599,6 @@ Style/ClassVars: Style/FormatStringToken: EnforcedStyle: unannotated -# Offense count: 336 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: always, always_true, never -Style/FrozenStringLiteralComment: - Exclude: - - '.simplecov' - - 'app/controllers/admin/bulk_line_items_controller.rb' - - 'app/controllers/admin/column_preferences_controller.rb' - - 'app/controllers/admin/contents_controller.rb' - - 'app/controllers/admin/customers_controller.rb' - - 'app/controllers/admin/enterprise_fees_controller.rb' - - 'app/controllers/admin/enterprise_groups_controller.rb' - - 'app/controllers/admin/enterprise_relationships_controller.rb' - - 'app/controllers/admin/enterprise_roles_controller.rb' - - 'app/controllers/admin/enterprises_controller.rb' - - 'app/controllers/admin/inventory_items_controller.rb' - - 'app/controllers/admin/invoice_settings_controller.rb' - - 'app/controllers/admin/manager_invitations_controller.rb' - - 'app/controllers/admin/matomo_settings_controller.rb' - - 'app/controllers/admin/order_cycles_controller.rb' - - 'app/controllers/admin/producer_properties_controller.rb' - - 'app/controllers/admin/product_import_controller.rb' - - 'app/controllers/admin/proxy_orders_controller.rb' - - 'app/controllers/admin/resource_controller.rb' - - 'app/controllers/admin/schedules_controller.rb' - - 'app/controllers/admin/stripe_accounts_controller.rb' - - 'app/controllers/admin/stripe_connect_settings_controller.rb' - - 'app/controllers/admin/subscription_line_items_controller.rb' - - 'app/controllers/admin/subscriptions_controller.rb' - - 'app/controllers/admin/tag_rules_controller.rb' - - 'app/controllers/admin/variant_overrides_controller.rb' - - 'app/controllers/api/v0/taxons_controller.rb' - - 'app/controllers/cart_controller.rb' - - 'app/controllers/discourse_sso_controller.rb' - - 'app/controllers/enterprises_controller.rb' - - 'app/controllers/groups_controller.rb' - - 'app/controllers/home_controller.rb' - - 'app/controllers/line_items_controller.rb' - - 'app/controllers/map_controller.rb' - - 'app/controllers/metal_decorator.rb' - - 'app/controllers/producers_controller.rb' - - 'app/controllers/registration_controller.rb' - - 'app/controllers/shop_controller.rb' - - 'app/controllers/shops_controller.rb' - - 'app/controllers/sitemap_controller.rb' - - 'app/controllers/spree/admin/adjustments_controller.rb' - - 'app/controllers/spree/admin/base_controller.rb' - - 'app/controllers/spree/admin/countries_controller.rb' - - 'app/controllers/spree/admin/general_settings_controller.rb' - - 'app/controllers/spree/admin/images_controller.rb' - - 'app/controllers/spree/admin/invoices_controller.rb' - - 'app/controllers/spree/admin/mail_methods_controller.rb' - - 'app/controllers/spree/admin/orders/customer_details_controller.rb' - - 'app/controllers/spree/admin/orders_controller.rb' - - 'app/controllers/spree/admin/overview_controller.rb' - - 'app/controllers/spree/admin/payment_methods_controller.rb' - - 'app/controllers/spree/admin/product_properties_controller.rb' - - 'app/controllers/spree/admin/products_controller.rb' - - 'app/controllers/spree/admin/properties_controller.rb' - - 'app/controllers/spree/admin/reports_controller.rb' - - 'app/controllers/spree/admin/return_authorizations_controller.rb' - - 'app/controllers/spree/admin/search_controller.rb' - - 'app/controllers/spree/admin/shipping_categories_controller.rb' - - 'app/controllers/spree/admin/shipping_methods_controller.rb' - - 'app/controllers/spree/admin/states_controller.rb' - - 'app/controllers/spree/admin/tax_categories_controller.rb' - - 'app/controllers/spree/admin/tax_rates_controller.rb' - - 'app/controllers/spree/admin/tax_settings_controller.rb' - - 'app/controllers/spree/admin/taxonomies_controller.rb' - - 'app/controllers/spree/admin/taxons_controller.rb' - - 'app/controllers/spree/admin/users_controller.rb' - - 'app/controllers/spree/admin/variants_controller.rb' - - 'app/controllers/spree/admin/zones_controller.rb' - - 'app/controllers/spree/orders_controller.rb' - - 'app/controllers/spree/users_controller.rb' - - 'app/controllers/stripe/callbacks_controller.rb' - - 'app/controllers/stripe/webhooks_controller.rb' - - 'app/controllers/user_confirmations_controller.rb' - - 'app/controllers/user_passwords_controller.rb' - - 'app/controllers/user_registrations_controller.rb' - - 'app/helpers/admin/enterprises_helper.rb' - - 'app/helpers/admin/injection_helper.rb' - - 'app/helpers/admin/orders_helper.rb' - - 'app/helpers/admin/subscriptions_helper.rb' - - 'app/helpers/angular_form_builder.rb' - - 'app/helpers/angular_form_helper.rb' - - 'app/helpers/application_helper.rb' - - 'app/helpers/checkout_helper.rb' - - 'app/helpers/discourse_helper.rb' - - 'app/helpers/enterprise_fees_helper.rb' - - 'app/helpers/enterprises_helper.rb' - - 'app/helpers/footer_links_helper.rb' - - 'app/helpers/groups_helper.rb' - - 'app/helpers/i18n_helper.rb' - - 'app/helpers/injection_helper.rb' - - 'app/helpers/map_helper.rb' - - 'app/helpers/markdown_helper.rb' - - 'app/helpers/serializer_helper.rb' - - 'app/helpers/shared_helper.rb' - - 'app/helpers/shop_helper.rb' - - 'app/helpers/shop_mail_helper.rb' - - 'app/helpers/spree/admin/base_helper.rb' - - 'app/helpers/spree/admin/general_settings_helper.rb' - - 'app/helpers/spree/admin/orders_helper.rb' - - 'app/helpers/spree/admin/taxons_helper.rb' - - 'app/helpers/spree/admin/zones_helper.rb' - - 'app/helpers/spree/orders_helper.rb' - - 'app/helpers/spree/payment_methods_helper.rb' - - 'app/helpers/spree/reports_helper.rb' - - 'app/helpers/spree_currency_helper.rb' - - 'app/jobs/subscription_confirm_job.rb' - - 'app/jobs/subscription_placement_job.rb' - - 'app/mailers/enterprise_mailer.rb' - - 'app/mailers/spree/user_mailer.rb' - - 'app/mailers/subscription_mailer.rb' - - 'app/models/adjustment_metadata.rb' - - 'app/models/calculator/flat_percent_per_item.rb' - - 'app/models/calculator/weight.rb' - - 'app/models/column_preference.rb' - - 'app/models/concerns/address_display.rb' - - 'app/models/concerns/adjustment_scopes.rb' - - 'app/models/concerns/order_shipment.rb' - - 'app/models/concerns/product_stock.rb' - - 'app/models/concerns/stock_settings_override_validation.rb' - - 'app/models/concerns/variant_stock.rb' - - 'app/models/content_configuration.rb' - - 'app/models/coordinator_fee.rb' - - 'app/models/customer.rb' - - 'app/models/distributor_shipping_method.rb' - - 'app/models/enterprise_fee.rb' - - 'app/models/enterprise_relationship_permission.rb' - - 'app/models/enterprise_role.rb' - - 'app/models/exchange.rb' - - 'app/models/exchange_fee.rb' - - 'app/models/exchange_variant.rb' - - 'app/models/inventory_item.rb' - - 'app/models/order_cycle.rb' - - 'app/models/preference_sections/footer_and_external_links_section.rb' - - 'app/models/preference_sections/group_signup_page_section.rb' - - 'app/models/preference_sections/header_section.rb' - - 'app/models/preference_sections/home_page_section.rb' - - 'app/models/preference_sections/hub_signup_page_section.rb' - - 'app/models/preference_sections/main_links_section.rb' - - 'app/models/preference_sections/producer_signup_page_section.rb' - - 'app/models/preference_sections/user_guide_section.rb' - - 'app/models/producer_property.rb' - - 'app/models/product_import/entry_processor.rb' - - 'app/models/product_import/entry_validator.rb' - - 'app/models/product_import/inventory_reset_strategy.rb' - - 'app/models/product_import/product_importer.rb' - - 'app/models/product_import/reset_absent.rb' - - 'app/models/product_import/settings.rb' - - 'app/models/product_import/spreadsheet_data.rb' - - 'app/models/product_import/spreadsheet_entry.rb' - - 'app/models/product_import/unit_converter.rb' - - 'app/models/proxy_order.rb' - - 'app/models/schedule.rb' - - 'app/models/spree/gateway/stripe_connect.rb' - - 'app/models/spree/preferences/file_configuration.rb' - - 'app/models/spree/property.rb' - - 'app/models/spree/user.rb' - - 'app/models/stripe_account.rb' - - 'app/models/subscription.rb' - - 'app/models/subscription_line_item.rb' - - 'app/models/tag_rule.rb' - - 'app/models/tag_rule/filter_order_cycles.rb' - - 'app/models/tag_rule/filter_payment_methods.rb' - - 'app/models/tag_rule/filter_products.rb' - - 'app/models/tag_rule/filter_shipping_methods.rb' - - 'app/serializers/api/address_serializer.rb' - - 'app/serializers/api/adjustment_serializer.rb' - - 'app/serializers/api/cached_enterprise_serializer.rb' - - 'app/serializers/api/country_serializer.rb' - - 'app/serializers/api/credit_card_serializer.rb' - - 'app/serializers/api/currency_config_serializer.rb' - - 'app/serializers/api/current_order_serializer.rb' - - 'app/serializers/api/customer_serializer.rb' - - 'app/serializers/api/enterprise_serializer.rb' - - 'app/serializers/api/enterprise_shopfront_list_serializer.rb' - - 'app/serializers/api/enterprise_shopfront_serializer.rb' - - 'app/serializers/api/enterprise_thin_serializer.rb' - - 'app/serializers/api/group_list_serializer.rb' - - 'app/serializers/api/id_name_serializer.rb' - - 'app/serializers/api/id_serializer.rb' - - 'app/serializers/api/image_serializer.rb' - - 'app/serializers/api/line_item_serializer.rb' - - 'app/serializers/api/order_cycle_serializer.rb' - - 'app/serializers/api/order_detailed_serializer.rb' - - 'app/serializers/api/order_serializer.rb' - - 'app/serializers/api/payment_method_serializer.rb' - - 'app/serializers/api/payment_serializer.rb' - - 'app/serializers/api/product_serializer.rb' - - 'app/serializers/api/property_serializer.rb' - - 'app/serializers/api/rails_flash_serializer.rb' - - 'app/serializers/api/shipment_serializer.rb' - - 'app/serializers/api/shipping_method_serializer.rb' - - 'app/serializers/api/shop_for_orders_serializer.rb' - - 'app/serializers/api/state_serializer.rb' - - 'app/serializers/api/taxon_jstree_attribute_serializer.rb' - - 'app/serializers/api/taxon_jstree_serializer.rb' - - 'app/serializers/api/taxon_serializer.rb' - - 'app/serializers/api/uncached_enterprise_serializer.rb' - - 'app/serializers/api/user_serializer.rb' - - 'app/serializers/api/variant_serializer.rb' - - 'app/services/bulk_invoice_service.rb' - - 'app/services/cart_service.rb' - - 'app/services/create_order_cycle.rb' - - 'app/services/current_order_locker.rb' - - 'app/services/default_country.rb' - - 'app/services/default_shipping_category.rb' - - 'app/services/default_stock_location.rb' - - 'app/services/embedded_page_service.rb' - - 'app/services/exchange_variant_bulk_updater.rb' - - 'app/services/exchange_variant_deleter.rb' - - 'app/services/invoice_renderer.rb' - - 'app/services/line_item_syncer.rb' - - 'app/services/mail_configuration.rb' - - 'app/services/order_adjustments_fetcher.rb' - - 'app/services/order_cycle_distributed_products.rb' - - 'app/services/order_cycle_distributed_variants.rb' - - 'app/services/order_cycle_form.rb' - - 'app/services/order_factory.rb' - - 'app/services/order_syncer.rb' - - 'app/services/order_update_issues.rb' - - 'app/services/order_workflow.rb' - - 'app/services/permissions/order.rb' - - 'app/services/product_tag_rules_filterer.rb' - - 'app/services/products_renderer.rb' - - 'app/services/search_orders.rb' - - 'app/services/tax_rate_finder.rb' - - 'app/services/terms_of_service.rb' - - 'app/services/upload_sanitizer.rb' - - 'app/services/variant_deleter.rb' - - 'app/services/variant_units/variant_and_line_item_naming.rb' - - 'app/services/variants_stock_levels.rb' - - 'app/validators/date_time_string_validator.rb' - - 'app/validators/distributors_validator.rb' - - 'app/validators/integer_array_validator.rb' - - 'engines/order_management/app/controllers/order_management/application_controller.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/authorizer.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/exchange_order_fee.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/incoming_exchange_line_item_fee.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/outgoing_exchange_line_item_fee.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/payment_method_fee.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/shipping_method_fee.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/using_enterprise_fee.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/with_i18n.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/permissions.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/csv_renderer.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/html_renderer.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_service.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb' - - 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/summarizer.rb' - - 'engines/order_management/app/services/reports.rb' - - 'engines/order_management/app/services/reports/authorizer.rb' - - 'engines/order_management/app/services/reports/parameters/base.rb' - - 'engines/order_management/app/services/reports/permissions.rb' - - 'engines/order_management/app/services/reports/renderers/base.rb' - - 'engines/order_management/app/services/reports/report_data/base.rb' - - 'engines/web/app/controllers/web/angular_templates_controller.rb' - - 'engines/web/app/controllers/web/application_controller.rb' - - 'engines/web/app/helpers/web/cookies_policy_helper.rb' - - 'engines/web/lib/web/cookies_consent.rb' - - 'lib/discourse/single_sign_on.rb' - - 'lib/open_food_network/address_finder.rb' - - 'lib/open_food_network/available_payment_method_filter.rb' - - 'lib/open_food_network/column_preference_defaults.rb' - - 'lib/open_food_network/customers_report.rb' - - 'lib/open_food_network/enterprise_fee_applicator.rb' - - 'lib/open_food_network/enterprise_fee_calculator.rb' - - 'lib/open_food_network/enterprise_injection_data.rb' - - 'lib/open_food_network/enterprise_issue_validator.rb' - - 'lib/open_food_network/error_logger.rb' - - 'lib/open_food_network/feature_toggle.rb' - - '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/order_and_distributor_report.rb' - - 'lib/open_food_network/order_cycle_form_applicator.rb' - - 'lib/open_food_network/order_grouper.rb' - - 'lib/open_food_network/orders_and_fulfillments_report.rb' - - 'lib/open_food_network/orders_and_fulfillments_report/customer_totals_report.rb' - - 'lib/open_food_network/orders_and_fulfillments_report/default_report.rb' - - 'lib/open_food_network/orders_and_fulfillments_report/distributor_totals_by_supplier_report.rb' - - 'lib/open_food_network/orders_and_fulfillments_report/supplier_totals_by_distributor_report.rb' - - 'lib/open_food_network/orders_and_fulfillments_report/supplier_totals_report.rb' - - 'lib/open_food_network/packing_report.rb' - - 'lib/open_food_network/paperclippable.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' - - 'lib/open_food_network/property_merge.rb' - - 'lib/open_food_network/referer_parser.rb' - - 'lib/open_food_network/reports/line_items.rb' - - 'lib/open_food_network/reports/list.rb' - - 'lib/open_food_network/sales_tax_report.rb' - - 'lib/open_food_network/scope_product_to_hub.rb' - - 'lib/open_food_network/scope_variant_to_hub.rb' - - 'lib/open_food_network/scope_variants_for_search.rb' - - 'lib/open_food_network/spree_api_key_loader.rb' - - 'lib/open_food_network/tag_rule_applicator.rb' - - 'lib/open_food_network/users_and_enterprises_report.rb' - - 'lib/open_food_network/xero_invoices_report.rb' - - 'lib/spree/authentication_helpers.rb' - - 'lib/stripe/account_connector.rb' - - 'lib/stripe/profile_storer.rb' - - 'lib/stripe/webhook_handler.rb' - - 'lib/tasks/data.rake' - - 'lib/tasks/data/anonymize_data.rake' - - 'lib/tasks/enterprises.rake' - - 'lib/tasks/karma.rake' - - 'lib/tasks/missing_payments.rake' - - 'lib/tasks/sample_data.rake' - - 'lib/tasks/sample_data/addressing.rb' - - 'lib/tasks/sample_data/customer_factory.rb' - - 'lib/tasks/sample_data/enterprise_factory.rb' - - 'lib/tasks/sample_data/fee_factory.rb' - - 'lib/tasks/sample_data/group_factory.rb' - - 'lib/tasks/sample_data/inventory_factory.rb' - - 'lib/tasks/sample_data/logging.rb' - - 'lib/tasks/sample_data/order_cycle_factory.rb' - - 'lib/tasks/sample_data/payment_method_factory.rb' - - 'lib/tasks/sample_data/permission_factory.rb' - - 'lib/tasks/sample_data/product_factory.rb' - - 'lib/tasks/sample_data/shipping_method_factory.rb' - - 'lib/tasks/sample_data/taxon_factory.rb' - - 'lib/tasks/sample_data/user_factory.rb' - - 'lib/tasks/specs.rake' - - 'lib/tasks/users.rake' - - 'spec/components/distributor_title_component_spec.rb' - - 'spec/components/example_component_spec.rb' - - 'spec/components/stories/distributor_title_component_stories.rb' - - 'spec/components/stories/example_component_stories.rb' - - 'spec/features/consumer/shopping/unit_price_spec.rb' - - 'spec/helpers/terms_and_conditions_helper_spec.rb' - - 'spec/lib/open_food_network/reports/line_items_spec.rb' - - 'spec/models/concerns/balance_spec.rb' - - 'spec/services/order_data_masker_spec.rb' - # Offense count: 6 # Cop supports --auto-correct. Style/GlobalStdStream: diff --git a/.simplecov b/.simplecov index d60a2ab165..3a307c0101 100755 --- a/.simplecov +++ b/.simplecov @@ -1,4 +1,5 @@ #!/bin/env ruby +# frozen_string_literal: true SimpleCov.start 'rails' do add_filter '/bin/' diff --git a/app/controllers/admin/bulk_line_items_controller.rb b/app/controllers/admin/bulk_line_items_controller.rb index 91973448e9..4e3d46e565 100644 --- a/app/controllers/admin/bulk_line_items_controller.rb +++ b/app/controllers/admin/bulk_line_items_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class BulkLineItemsController < Spree::Admin::BaseController include PaginationData diff --git a/app/controllers/admin/column_preferences_controller.rb b/app/controllers/admin/column_preferences_controller.rb index 4ff7734f22..fcf627f1b7 100644 --- a/app/controllers/admin/column_preferences_controller.rb +++ b/app/controllers/admin/column_preferences_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class ColumnPreferencesController < Admin::ResourceController before_action :load_collection, only: [:bulk_update] diff --git a/app/controllers/admin/contents_controller.rb b/app/controllers/admin/contents_controller.rb index fef900f517..5841fa84eb 100644 --- a/app/controllers/admin/contents_controller.rb +++ b/app/controllers/admin/contents_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class ContentsController < Spree::Admin::BaseController def edit diff --git a/app/controllers/admin/customers_controller.rb b/app/controllers/admin/customers_controller.rb index e712812389..71cc8fc2c8 100644 --- a/app/controllers/admin/customers_controller.rb +++ b/app/controllers/admin/customers_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/address_finder' module Admin diff --git a/app/controllers/admin/enterprise_fees_controller.rb b/app/controllers/admin/enterprise_fees_controller.rb index 9aec7fdc26..54a320785f 100644 --- a/app/controllers/admin/enterprise_fees_controller.rb +++ b/app/controllers/admin/enterprise_fees_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class EnterpriseFeesController < Admin::ResourceController before_action :load_enterprise_fee_set, only: :index diff --git a/app/controllers/admin/enterprise_groups_controller.rb b/app/controllers/admin/enterprise_groups_controller.rb index bfd5cca831..56b2468b5f 100644 --- a/app/controllers/admin/enterprise_groups_controller.rb +++ b/app/controllers/admin/enterprise_groups_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class EnterpriseGroupsController < Admin::ResourceController before_action :load_data, except: :index diff --git a/app/controllers/admin/enterprise_relationships_controller.rb b/app/controllers/admin/enterprise_relationships_controller.rb index 6160293c84..3a6fd6d429 100644 --- a/app/controllers/admin/enterprise_relationships_controller.rb +++ b/app/controllers/admin/enterprise_relationships_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class EnterpriseRelationshipsController < Admin::ResourceController def index diff --git a/app/controllers/admin/enterprise_roles_controller.rb b/app/controllers/admin/enterprise_roles_controller.rb index 04a171d213..79a52d8b41 100644 --- a/app/controllers/admin/enterprise_roles_controller.rb +++ b/app/controllers/admin/enterprise_roles_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class EnterpriseRolesController < Admin::ResourceController def index diff --git a/app/controllers/admin/enterprises_controller.rb b/app/controllers/admin/enterprises_controller.rb index 0174a3a562..c2a9460447 100644 --- a/app/controllers/admin/enterprises_controller.rb +++ b/app/controllers/admin/enterprises_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/referer_parser' require 'open_food_network/permissions' require 'open_food_network/order_cycle_permissions' diff --git a/app/controllers/admin/inventory_items_controller.rb b/app/controllers/admin/inventory_items_controller.rb index 514b6ad48a..4a2e40178c 100644 --- a/app/controllers/admin/inventory_items_controller.rb +++ b/app/controllers/admin/inventory_items_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class InventoryItemsController < Admin::ResourceController respond_to :json diff --git a/app/controllers/admin/invoice_settings_controller.rb b/app/controllers/admin/invoice_settings_controller.rb index 0e52797b6b..36548e7df3 100644 --- a/app/controllers/admin/invoice_settings_controller.rb +++ b/app/controllers/admin/invoice_settings_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class InvoiceSettingsController < Spree::Admin::BaseController def update diff --git a/app/controllers/admin/manager_invitations_controller.rb b/app/controllers/admin/manager_invitations_controller.rb index 83cb6b0882..39ea737021 100644 --- a/app/controllers/admin/manager_invitations_controller.rb +++ b/app/controllers/admin/manager_invitations_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class ManagerInvitationsController < Spree::Admin::BaseController authorize_resource class: false diff --git a/app/controllers/admin/matomo_settings_controller.rb b/app/controllers/admin/matomo_settings_controller.rb index 63196910f9..0775e4ab3f 100644 --- a/app/controllers/admin/matomo_settings_controller.rb +++ b/app/controllers/admin/matomo_settings_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class MatomoSettingsController < Spree::Admin::BaseController def update diff --git a/app/controllers/admin/order_cycles_controller.rb b/app/controllers/admin/order_cycles_controller.rb index 3710cd0f2a..05b6cb891d 100644 --- a/app/controllers/admin/order_cycles_controller.rb +++ b/app/controllers/admin/order_cycles_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class OrderCyclesController < Admin::ResourceController include OrderCyclesHelper diff --git a/app/controllers/admin/producer_properties_controller.rb b/app/controllers/admin/producer_properties_controller.rb index d2a4784a29..2ce3aca0db 100644 --- a/app/controllers/admin/producer_properties_controller.rb +++ b/app/controllers/admin/producer_properties_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class ProducerPropertiesController < Admin::ResourceController before_action :load_enterprise diff --git a/app/controllers/admin/product_import_controller.rb b/app/controllers/admin/product_import_controller.rb index 3a18aeecea..6c3dce8334 100644 --- a/app/controllers/admin/product_import_controller.rb +++ b/app/controllers/admin/product_import_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'roo' module Admin diff --git a/app/controllers/admin/proxy_orders_controller.rb b/app/controllers/admin/proxy_orders_controller.rb index c97bac2fc8..fbe51e5069 100644 --- a/app/controllers/admin/proxy_orders_controller.rb +++ b/app/controllers/admin/proxy_orders_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class ProxyOrdersController < Admin::ResourceController respond_to :json diff --git a/app/controllers/admin/resource_controller.rb b/app/controllers/admin/resource_controller.rb index 3510093c0d..56fa7c5a5f 100644 --- a/app/controllers/admin/resource_controller.rb +++ b/app/controllers/admin/resource_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class ResourceController < Spree::Admin::BaseController helper_method :new_object_url, :edit_object_url, :object_url, :collection_url diff --git a/app/controllers/admin/schedules_controller.rb b/app/controllers/admin/schedules_controller.rb index baa30ff1ff..e961f59b26 100644 --- a/app/controllers/admin/schedules_controller.rb +++ b/app/controllers/admin/schedules_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/permissions' require 'order_management/subscriptions/proxy_order_syncer' diff --git a/app/controllers/admin/stripe_accounts_controller.rb b/app/controllers/admin/stripe_accounts_controller.rb index 91ae8a3403..b72175ac05 100644 --- a/app/controllers/admin/stripe_accounts_controller.rb +++ b/app/controllers/admin/stripe_accounts_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'stripe/account_connector' module Admin diff --git a/app/controllers/admin/stripe_connect_settings_controller.rb b/app/controllers/admin/stripe_connect_settings_controller.rb index 3b7ab969e2..81181b23c9 100644 --- a/app/controllers/admin/stripe_connect_settings_controller.rb +++ b/app/controllers/admin/stripe_connect_settings_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This controller is used by super admin users to update the settings the app is using module Admin diff --git a/app/controllers/admin/subscription_line_items_controller.rb b/app/controllers/admin/subscription_line_items_controller.rb index 312e8846d7..b16d486225 100644 --- a/app/controllers/admin/subscription_line_items_controller.rb +++ b/app/controllers/admin/subscription_line_items_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/permissions' require 'open_food_network/order_cycle_permissions' require 'open_food_network/scope_variant_to_hub' diff --git a/app/controllers/admin/subscriptions_controller.rb b/app/controllers/admin/subscriptions_controller.rb index a194c6b566..315a1a3c8b 100644 --- a/app/controllers/admin/subscriptions_controller.rb +++ b/app/controllers/admin/subscriptions_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/permissions' module Admin diff --git a/app/controllers/admin/tag_rules_controller.rb b/app/controllers/admin/tag_rules_controller.rb index 8ddbf82c83..fd00ea66be 100644 --- a/app/controllers/admin/tag_rules_controller.rb +++ b/app/controllers/admin/tag_rules_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin class TagRulesController < Admin::ResourceController respond_to :json diff --git a/app/controllers/admin/variant_overrides_controller.rb b/app/controllers/admin/variant_overrides_controller.rb index 6c20f59f44..33cc09fcf6 100644 --- a/app/controllers/admin/variant_overrides_controller.rb +++ b/app/controllers/admin/variant_overrides_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/spree_api_key_loader' module Admin diff --git a/app/controllers/api/v0/taxons_controller.rb b/app/controllers/api/v0/taxons_controller.rb index b3e74d0dac..f5529b7fcb 100644 --- a/app/controllers/api/v0/taxons_controller.rb +++ b/app/controllers/api/v0/taxons_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api module V0 class TaxonsController < Api::V0::BaseController diff --git a/app/controllers/cart_controller.rb b/app/controllers/cart_controller.rb index 8ea8d31ab0..755b994a4c 100644 --- a/app/controllers/cart_controller.rb +++ b/app/controllers/cart_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CartController < BaseController before_action :check_authorization diff --git a/app/controllers/discourse_sso_controller.rb b/app/controllers/discourse_sso_controller.rb index e6753fb3db..8ac609e931 100644 --- a/app/controllers/discourse_sso_controller.rb +++ b/app/controllers/discourse_sso_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'discourse/single_sign_on' class DiscourseSsoController < ApplicationController diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb index 841c9c76ff..93fb69053f 100644 --- a/app/controllers/enterprises_controller.rb +++ b/app/controllers/enterprises_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/enterprise_injection_data' class EnterprisesController < BaseController diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index d13876304e..c027a060e1 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class GroupsController < BaseController layout 'darkswarm' diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index c7612d3997..bcc04e8365 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HomeController < BaseController layout 'darkswarm' diff --git a/app/controllers/line_items_controller.rb b/app/controllers/line_items_controller.rb index b61d476d2e..50173af542 100644 --- a/app/controllers/line_items_controller.rb +++ b/app/controllers/line_items_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class LineItemsController < BaseController respond_to :json diff --git a/app/controllers/map_controller.rb b/app/controllers/map_controller.rb index 91c591e628..a64562762e 100644 --- a/app/controllers/map_controller.rb +++ b/app/controllers/map_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class MapController < BaseController layout 'darkswarm' diff --git a/app/controllers/metal_decorator.rb b/app/controllers/metal_decorator.rb index 0c8f81501f..9e9364fa81 100644 --- a/app/controllers/metal_decorator.rb +++ b/app/controllers/metal_decorator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # For the API ActionController::Metal.class_eval do def spree_current_user diff --git a/app/controllers/producers_controller.rb b/app/controllers/producers_controller.rb index 108143e5e3..38e4e1c00f 100644 --- a/app/controllers/producers_controller.rb +++ b/app/controllers/producers_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ProducersController < BaseController layout 'darkswarm' diff --git a/app/controllers/registration_controller.rb b/app/controllers/registration_controller.rb index 11f37fec13..29b523289e 100644 --- a/app/controllers/registration_controller.rb +++ b/app/controllers/registration_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/spree_api_key_loader' class RegistrationController < BaseController diff --git a/app/controllers/shop_controller.rb b/app/controllers/shop_controller.rb index c5f90a2856..b992d21a79 100644 --- a/app/controllers/shop_controller.rb +++ b/app/controllers/shop_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ShopController < BaseController layout "darkswarm" before_action :require_distributor_chosen, :set_order_cycles, except: :changeable_orders_alert diff --git a/app/controllers/shops_controller.rb b/app/controllers/shops_controller.rb index d644a5010f..6fc655c8bb 100644 --- a/app/controllers/shops_controller.rb +++ b/app/controllers/shops_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ShopsController < BaseController layout 'darkswarm' diff --git a/app/controllers/sitemap_controller.rb b/app/controllers/sitemap_controller.rb index 103b6e93ee..c711fde412 100644 --- a/app/controllers/sitemap_controller.rb +++ b/app/controllers/sitemap_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SitemapController < ApplicationController layout nil diff --git a/app/controllers/spree/admin/adjustments_controller.rb b/app/controllers/spree/admin/adjustments_controller.rb index 81e2194605..d86edaaac1 100644 --- a/app/controllers/spree/admin/adjustments_controller.rb +++ b/app/controllers/spree/admin/adjustments_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class AdjustmentsController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/base_controller.rb b/app/controllers/spree/admin/base_controller.rb index 34e0202bdd..43115c5a46 100644 --- a/app/controllers/spree/admin/base_controller.rb +++ b/app/controllers/spree/admin/base_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class BaseController < ApplicationController diff --git a/app/controllers/spree/admin/countries_controller.rb b/app/controllers/spree/admin/countries_controller.rb index 3cb6f78947..591014bd33 100644 --- a/app/controllers/spree/admin/countries_controller.rb +++ b/app/controllers/spree/admin/countries_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class CountriesController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/general_settings_controller.rb b/app/controllers/spree/admin/general_settings_controller.rb index 6a7f116c89..3400686cf0 100644 --- a/app/controllers/spree/admin/general_settings_controller.rb +++ b/app/controllers/spree/admin/general_settings_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class GeneralSettingsController < Spree::Admin::BaseController diff --git a/app/controllers/spree/admin/images_controller.rb b/app/controllers/spree/admin/images_controller.rb index 0757a78bf7..b258ef8e2c 100644 --- a/app/controllers/spree/admin/images_controller.rb +++ b/app/controllers/spree/admin/images_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class ImagesController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/invoices_controller.rb b/app/controllers/spree/admin/invoices_controller.rb index 710fda1a3a..27d0009e53 100644 --- a/app/controllers/spree/admin/invoices_controller.rb +++ b/app/controllers/spree/admin/invoices_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class InvoicesController < Spree::Admin::BaseController diff --git a/app/controllers/spree/admin/mail_methods_controller.rb b/app/controllers/spree/admin/mail_methods_controller.rb index 860f98bb49..df53f9275b 100644 --- a/app/controllers/spree/admin/mail_methods_controller.rb +++ b/app/controllers/spree/admin/mail_methods_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class MailMethodsController < Spree::Admin::BaseController diff --git a/app/controllers/spree/admin/orders/customer_details_controller.rb b/app/controllers/spree/admin/orders/customer_details_controller.rb index 56502d54a0..a476c31fd2 100644 --- a/app/controllers/spree/admin/orders/customer_details_controller.rb +++ b/app/controllers/spree/admin/orders/customer_details_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin module Orders diff --git a/app/controllers/spree/admin/orders_controller.rb b/app/controllers/spree/admin/orders_controller.rb index 51f4bbe84d..505a182d39 100644 --- a/app/controllers/spree/admin/orders_controller.rb +++ b/app/controllers/spree/admin/orders_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/spree_api_key_loader' module Spree diff --git a/app/controllers/spree/admin/overview_controller.rb b/app/controllers/spree/admin/overview_controller.rb index d8bc38293a..229832514b 100644 --- a/app/controllers/spree/admin/overview_controller.rb +++ b/app/controllers/spree/admin/overview_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # this clas was inspired (heavily) from the mephisto admin architecture module Spree module Admin diff --git a/app/controllers/spree/admin/payment_methods_controller.rb b/app/controllers/spree/admin/payment_methods_controller.rb index 0544f94faa..72ac7a7a35 100644 --- a/app/controllers/spree/admin/payment_methods_controller.rb +++ b/app/controllers/spree/admin/payment_methods_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class PaymentMethodsController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/product_properties_controller.rb b/app/controllers/spree/admin/product_properties_controller.rb index 6c0b828641..c92f024d1f 100644 --- a/app/controllers/spree/admin/product_properties_controller.rb +++ b/app/controllers/spree/admin/product_properties_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class ProductPropertiesController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/products_controller.rb b/app/controllers/spree/admin/products_controller.rb index 2e2292b257..0441b9a2f2 100644 --- a/app/controllers/spree/admin/products_controller.rb +++ b/app/controllers/spree/admin/products_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/spree_api_key_loader' require 'open_food_network/referer_parser' require 'open_food_network/permissions' diff --git a/app/controllers/spree/admin/properties_controller.rb b/app/controllers/spree/admin/properties_controller.rb index 87cf620e5a..3b53b4b937 100644 --- a/app/controllers/spree/admin/properties_controller.rb +++ b/app/controllers/spree/admin/properties_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class PropertiesController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/reports_controller.rb b/app/controllers/spree/admin/reports_controller.rb index bace8b7f1a..f0976ca4c1 100644 --- a/app/controllers/spree/admin/reports_controller.rb +++ b/app/controllers/spree/admin/reports_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'csv' require 'open_food_network/reports/list' diff --git a/app/controllers/spree/admin/return_authorizations_controller.rb b/app/controllers/spree/admin/return_authorizations_controller.rb index 313227f368..84b85ad345 100644 --- a/app/controllers/spree/admin/return_authorizations_controller.rb +++ b/app/controllers/spree/admin/return_authorizations_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class ReturnAuthorizationsController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/search_controller.rb b/app/controllers/spree/admin/search_controller.rb index 802667a352..9869254b83 100644 --- a/app/controllers/spree/admin/search_controller.rb +++ b/app/controllers/spree/admin/search_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class SearchController < Spree::Admin::BaseController diff --git a/app/controllers/spree/admin/shipping_categories_controller.rb b/app/controllers/spree/admin/shipping_categories_controller.rb index afb3c42f1b..fb689fe783 100644 --- a/app/controllers/spree/admin/shipping_categories_controller.rb +++ b/app/controllers/spree/admin/shipping_categories_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class ShippingCategoriesController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/shipping_methods_controller.rb b/app/controllers/spree/admin/shipping_methods_controller.rb index 4492690506..aa2e34b298 100644 --- a/app/controllers/spree/admin/shipping_methods_controller.rb +++ b/app/controllers/spree/admin/shipping_methods_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class ShippingMethodsController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/states_controller.rb b/app/controllers/spree/admin/states_controller.rb index 0105cdddd9..ce031f384d 100644 --- a/app/controllers/spree/admin/states_controller.rb +++ b/app/controllers/spree/admin/states_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class StatesController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/tax_categories_controller.rb b/app/controllers/spree/admin/tax_categories_controller.rb index f60c3d9174..e9d6547f48 100644 --- a/app/controllers/spree/admin/tax_categories_controller.rb +++ b/app/controllers/spree/admin/tax_categories_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class TaxCategoriesController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/tax_rates_controller.rb b/app/controllers/spree/admin/tax_rates_controller.rb index 9e75426b93..8ae4c3db2c 100644 --- a/app/controllers/spree/admin/tax_rates_controller.rb +++ b/app/controllers/spree/admin/tax_rates_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class TaxRatesController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/tax_settings_controller.rb b/app/controllers/spree/admin/tax_settings_controller.rb index 7ebeec543b..b43e3f615a 100644 --- a/app/controllers/spree/admin/tax_settings_controller.rb +++ b/app/controllers/spree/admin/tax_settings_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class TaxSettingsController < Spree::Admin::BaseController diff --git a/app/controllers/spree/admin/taxonomies_controller.rb b/app/controllers/spree/admin/taxonomies_controller.rb index c2e668f1b6..68f65e000e 100644 --- a/app/controllers/spree/admin/taxonomies_controller.rb +++ b/app/controllers/spree/admin/taxonomies_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class TaxonomiesController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/taxons_controller.rb b/app/controllers/spree/admin/taxons_controller.rb index 2d35da315b..ae625e9da6 100644 --- a/app/controllers/spree/admin/taxons_controller.rb +++ b/app/controllers/spree/admin/taxons_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class TaxonsController < Spree::Admin::BaseController diff --git a/app/controllers/spree/admin/users_controller.rb b/app/controllers/spree/admin/users_controller.rb index 032e3aed56..bf5c054015 100644 --- a/app/controllers/spree/admin/users_controller.rb +++ b/app/controllers/spree/admin/users_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class UsersController < ::Admin::ResourceController diff --git a/app/controllers/spree/admin/variants_controller.rb b/app/controllers/spree/admin/variants_controller.rb index c11c89b5af..fff1c5c139 100644 --- a/app/controllers/spree/admin/variants_controller.rb +++ b/app/controllers/spree/admin/variants_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/scope_variants_for_search' module Spree diff --git a/app/controllers/spree/admin/zones_controller.rb b/app/controllers/spree/admin/zones_controller.rb index d66512df44..f0acb77f22 100644 --- a/app/controllers/spree/admin/zones_controller.rb +++ b/app/controllers/spree/admin/zones_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin class ZonesController < ::Admin::ResourceController diff --git a/app/controllers/spree/orders_controller.rb b/app/controllers/spree/orders_controller.rb index df0c67af36..8f0162420d 100644 --- a/app/controllers/spree/orders_controller.rb +++ b/app/controllers/spree/orders_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree class OrdersController < ::BaseController include OrderCyclesHelper diff --git a/app/controllers/spree/users_controller.rb b/app/controllers/spree/users_controller.rb index 18effc349d..f97c4674ca 100644 --- a/app/controllers/spree/users_controller.rb +++ b/app/controllers/spree/users_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree class UsersController < ::BaseController layout 'darkswarm' diff --git a/app/controllers/stripe/callbacks_controller.rb b/app/controllers/stripe/callbacks_controller.rb index ee7a54b319..9eca54018f 100644 --- a/app/controllers/stripe/callbacks_controller.rb +++ b/app/controllers/stripe/callbacks_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'stripe/account_connector' module Stripe diff --git a/app/controllers/stripe/webhooks_controller.rb b/app/controllers/stripe/webhooks_controller.rb index 41470d9e70..7497228326 100644 --- a/app/controllers/stripe/webhooks_controller.rb +++ b/app/controllers/stripe/webhooks_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'stripe/webhook_handler' module Stripe diff --git a/app/controllers/user_confirmations_controller.rb b/app/controllers/user_confirmations_controller.rb index 0915447bc5..b024504345 100644 --- a/app/controllers/user_confirmations_controller.rb +++ b/app/controllers/user_confirmations_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserConfirmationsController < DeviseController # Needed for access to current_ability, so we can authorize! actions include Spree::Core::ControllerHelpers::Auth diff --git a/app/controllers/user_passwords_controller.rb b/app/controllers/user_passwords_controller.rb index 9314f5f41d..c33a1716f3 100644 --- a/app/controllers/user_passwords_controller.rb +++ b/app/controllers/user_passwords_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class UserPasswordsController < Spree::UserPasswordsController layout 'darkswarm' diff --git a/app/controllers/user_registrations_controller.rb b/app/controllers/user_registrations_controller.rb index f02309bf71..50638970f1 100644 --- a/app/controllers/user_registrations_controller.rb +++ b/app/controllers/user_registrations_controller.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + require 'open_food_network/error_logger' class UserRegistrationsController < Spree::UserRegistrationsController - I18N_SCOPE = 'devise.user_registrations.spree_user'.freeze + I18N_SCOPE = 'devise.user_registrations.spree_user' before_action :set_checkout_redirect, only: :create diff --git a/app/helpers/admin/enterprises_helper.rb b/app/helpers/admin/enterprises_helper.rb index 4f4bcde0f6..516caa9e1c 100644 --- a/app/helpers/admin/enterprises_helper.rb +++ b/app/helpers/admin/enterprises_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin module EnterprisesHelper def add_check_if_single(count) diff --git a/app/helpers/admin/injection_helper.rb b/app/helpers/admin/injection_helper.rb index c7cdd49c27..20482e0a4e 100644 --- a/app/helpers/admin/injection_helper.rb +++ b/app/helpers/admin/injection_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin module InjectionHelper def admin_inject_enterprise diff --git a/app/helpers/admin/orders_helper.rb b/app/helpers/admin/orders_helper.rb index 4be258821a..72a414bfd6 100644 --- a/app/helpers/admin/orders_helper.rb +++ b/app/helpers/admin/orders_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin module OrdersHelper # Adjustments to display under "Order adjustments". diff --git a/app/helpers/admin/subscriptions_helper.rb b/app/helpers/admin/subscriptions_helper.rb index 749584ea98..2f500ea55f 100644 --- a/app/helpers/admin/subscriptions_helper.rb +++ b/app/helpers/admin/subscriptions_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Admin module SubscriptionsHelper def subscriptions_setup_complete?(shops) diff --git a/app/helpers/angular_form_builder.rb b/app/helpers/angular_form_builder.rb index 5a5878c783..0fe5053f31 100644 --- a/app/helpers/angular_form_builder.rb +++ b/app/helpers/angular_form_builder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AngularFormBuilder < ActionView::Helpers::FormBuilder def ng_fields_for(record_name, *_args) raise "Nested ng_fields_for is not yet supported" if @fields_for_record_name.present? diff --git a/app/helpers/angular_form_helper.rb b/app/helpers/angular_form_helper.rb index e0dad2c651..dd4afe9d86 100644 --- a/app/helpers/angular_form_helper.rb +++ b/app/helpers/angular_form_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AngularFormHelper def ng_options_for_select(container, _angular_field = nil) return container if container.is_a?(String) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d41d47bbb8..969a258446 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ApplicationHelper include RawParams diff --git a/app/helpers/checkout_helper.rb b/app/helpers/checkout_helper.rb index f69752e2be..8f05035bdd 100644 --- a/app/helpers/checkout_helper.rb +++ b/app/helpers/checkout_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module CheckoutHelper def guest_checkout_allowed? current_order.distributor.allow_guest_orders? diff --git a/app/helpers/discourse_helper.rb b/app/helpers/discourse_helper.rb index 9e82c4d803..551636fe39 100644 --- a/app/helpers/discourse_helper.rb +++ b/app/helpers/discourse_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module DiscourseHelper def discourse_configured? discourse_url.present? diff --git a/app/helpers/enterprise_fees_helper.rb b/app/helpers/enterprise_fees_helper.rb index 55647b6413..e6af949901 100644 --- a/app/helpers/enterprise_fees_helper.rb +++ b/app/helpers/enterprise_fees_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module EnterpriseFeesHelper def angular_name(method) "sets_enterprise_fee_set[collection_attributes][{{ $index }}][#{method}]" diff --git a/app/helpers/enterprises_helper.rb b/app/helpers/enterprises_helper.rb index a5acd72966..397dff60f8 100644 --- a/app/helpers/enterprises_helper.rb +++ b/app/helpers/enterprises_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/available_payment_method_filter' module EnterprisesHelper diff --git a/app/helpers/footer_links_helper.rb b/app/helpers/footer_links_helper.rb index e084cca277..2cfb9f1c17 100644 --- a/app/helpers/footer_links_helper.rb +++ b/app/helpers/footer_links_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'web/cookies_consent' module FooterLinksHelper diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index 9ea6af9a1c..5f6b188abf 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module GroupsHelper def link_to_service(baseurl, name, html_options = {}, &block) return if name.blank? diff --git a/app/helpers/i18n_helper.rb b/app/helpers/i18n_helper.rb index 8c827e1bba..6ca7d9d5b4 100644 --- a/app/helpers/i18n_helper.rb +++ b/app/helpers/i18n_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module I18nHelper def set_locale UserLocaleSetter.new(spree_current_user, params[:locale], cookies).set_locale diff --git a/app/helpers/injection_helper.rb b/app/helpers/injection_helper.rb index 3af44f885f..cf2d268aa0 100644 --- a/app/helpers/injection_helper.rb +++ b/app/helpers/injection_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/enterprise_injection_data' module InjectionHelper diff --git a/app/helpers/map_helper.rb b/app/helpers/map_helper.rb index b2ef609c77..bc3b66c49c 100644 --- a/app/helpers/map_helper.rb +++ b/app/helpers/map_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module MapHelper def using_google_maps? ENV["GOOGLE_MAPS_API_KEY"].present? || google_maps_configured_with_geocoder_api_key? diff --git a/app/helpers/markdown_helper.rb b/app/helpers/markdown_helper.rb index 25fd093485..6b9a98129b 100644 --- a/app/helpers/markdown_helper.rb +++ b/app/helpers/markdown_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module MarkdownHelper def render_markdown(markdown) md ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML, no_intra_emphasis: true, tables: true, diff --git a/app/helpers/serializer_helper.rb b/app/helpers/serializer_helper.rb index f30d998f73..c3134e9c3f 100644 --- a/app/helpers/serializer_helper.rb +++ b/app/helpers/serializer_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SerializerHelper def ids_to_objs(ids) return [] if ids.blank? diff --git a/app/helpers/shared_helper.rb b/app/helpers/shared_helper.rb index 2c9bb17990..8d087e8aaa 100644 --- a/app/helpers/shared_helper.rb +++ b/app/helpers/shared_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SharedHelper def distributor_link_class(distributor) cart = current_order(true) diff --git a/app/helpers/shop_helper.rb b/app/helpers/shop_helper.rb index fbd48f719f..2f19c1d227 100644 --- a/app/helpers/shop_helper.rb +++ b/app/helpers/shop_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ShopHelper def oc_select_options @order_cycles.map { |oc| { time: pickup_time(oc), id: oc.id } } diff --git a/app/helpers/shop_mail_helper.rb b/app/helpers/shop_mail_helper.rb index ad97f878bb..924860d466 100644 --- a/app/helpers/shop_mail_helper.rb +++ b/app/helpers/shop_mail_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ShopMailHelper # Long datetime format string used in emails to customers # diff --git a/app/helpers/spree/admin/base_helper.rb b/app/helpers/spree/admin/base_helper.rb index 157762e823..3983cf3fda 100644 --- a/app/helpers/spree/admin/base_helper.rb +++ b/app/helpers/spree/admin/base_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin module BaseHelper diff --git a/app/helpers/spree/admin/general_settings_helper.rb b/app/helpers/spree/admin/general_settings_helper.rb index 29e491fe83..88d5a752dd 100644 --- a/app/helpers/spree/admin/general_settings_helper.rb +++ b/app/helpers/spree/admin/general_settings_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin module GeneralSettingsHelper diff --git a/app/helpers/spree/admin/orders_helper.rb b/app/helpers/spree/admin/orders_helper.rb index 112b264d7f..e631555560 100644 --- a/app/helpers/spree/admin/orders_helper.rb +++ b/app/helpers/spree/admin/orders_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin module OrdersHelper diff --git a/app/helpers/spree/admin/taxons_helper.rb b/app/helpers/spree/admin/taxons_helper.rb index 87ee61dbd5..e8e4d8d918 100644 --- a/app/helpers/spree/admin/taxons_helper.rb +++ b/app/helpers/spree/admin/taxons_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin module TaxonsHelper diff --git a/app/helpers/spree/admin/zones_helper.rb b/app/helpers/spree/admin/zones_helper.rb index fa8044e953..316672b105 100644 --- a/app/helpers/spree/admin/zones_helper.rb +++ b/app/helpers/spree/admin/zones_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Admin module ZonesHelper diff --git a/app/helpers/spree/orders_helper.rb b/app/helpers/spree/orders_helper.rb index 2ade8790d2..a2f4837b8a 100644 --- a/app/helpers/spree/orders_helper.rb +++ b/app/helpers/spree/orders_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module OrdersHelper def cart_is_empty diff --git a/app/helpers/spree/payment_methods_helper.rb b/app/helpers/spree/payment_methods_helper.rb index 361d6c6afd..50fe34d457 100644 --- a/app/helpers/spree/payment_methods_helper.rb +++ b/app/helpers/spree/payment_methods_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module PaymentMethodsHelper def payment_method(payment) diff --git a/app/helpers/spree/reports_helper.rb b/app/helpers/spree/reports_helper.rb index eb1c60cd3c..38fcd2a35e 100644 --- a/app/helpers/spree/reports_helper.rb +++ b/app/helpers/spree/reports_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spree/money' module Spree diff --git a/app/helpers/spree_currency_helper.rb b/app/helpers/spree_currency_helper.rb index 479ced2771..39e91c9918 100644 --- a/app/helpers/spree_currency_helper.rb +++ b/app/helpers/spree_currency_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module SpreeCurrencyHelper def spree_number_to_currency(amount) Spree::Money.new(amount).to_s diff --git a/app/jobs/subscription_confirm_job.rb b/app/jobs/subscription_confirm_job.rb index dce02e8ae8..e492036220 100644 --- a/app/jobs/subscription_confirm_job.rb +++ b/app/jobs/subscription_confirm_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'order_management/subscriptions/summarizer' # Confirms orders of unconfirmed proxy orders in recently closed Order Cycles diff --git a/app/jobs/subscription_placement_job.rb b/app/jobs/subscription_placement_job.rb index 2d5d726bb3..45a8de23cb 100644 --- a/app/jobs/subscription_placement_job.rb +++ b/app/jobs/subscription_placement_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'order_management/subscriptions/summarizer' class SubscriptionPlacementJob < ActiveJob::Base diff --git a/app/mailers/enterprise_mailer.rb b/app/mailers/enterprise_mailer.rb index 3ac2677a67..dd094c8de4 100644 --- a/app/mailers/enterprise_mailer.rb +++ b/app/mailers/enterprise_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'devise/mailers/helpers' class EnterpriseMailer < Spree::BaseMailer include Devise::Mailers::Helpers diff --git a/app/mailers/spree/user_mailer.rb b/app/mailers/spree/user_mailer.rb index 449f4c5dfc..f85b8a11a0 100644 --- a/app/mailers/spree/user_mailer.rb +++ b/app/mailers/spree/user_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This mailer is configured to be the Devise mailer # Some methods here override Devise::Mailer methods module Spree diff --git a/app/mailers/subscription_mailer.rb b/app/mailers/subscription_mailer.rb index 90efc9ee40..11900bde3b 100644 --- a/app/mailers/subscription_mailer.rb +++ b/app/mailers/subscription_mailer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SubscriptionMailer < Spree::BaseMailer helper 'checkout' helper MailerHelper diff --git a/app/models/adjustment_metadata.rb b/app/models/adjustment_metadata.rb index c282368aca..eb99ad1de7 100644 --- a/app/models/adjustment_metadata.rb +++ b/app/models/adjustment_metadata.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AdjustmentMetadata < ApplicationRecord belongs_to :adjustment, class_name: 'Spree::Adjustment' belongs_to :enterprise diff --git a/app/models/calculator/flat_percent_per_item.rb b/app/models/calculator/flat_percent_per_item.rb index 84d4f73b8f..f9e197c594 100644 --- a/app/models/calculator/flat_percent_per_item.rb +++ b/app/models/calculator/flat_percent_per_item.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spree/localized_number' class Calculator::FlatPercentPerItem < Spree::Calculator diff --git a/app/models/calculator/weight.rb b/app/models/calculator/weight.rb index 8f060bb826..405598ebb7 100644 --- a/app/models/calculator/weight.rb +++ b/app/models/calculator/weight.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spree/localized_number' module Calculator diff --git a/app/models/column_preference.rb b/app/models/column_preference.rb index 49dbec460d..a4e52b577c 100644 --- a/app/models/column_preference.rb +++ b/app/models/column_preference.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/column_preference_defaults' class ColumnPreference < ApplicationRecord diff --git a/app/models/concerns/address_display.rb b/app/models/concerns/address_display.rb index c585087e18..602fbae7c6 100644 --- a/app/models/concerns/address_display.rb +++ b/app/models/concerns/address_display.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AddressDisplay def full_name_reverse [lastname, firstname].reject(&:blank?).join(" ") diff --git a/app/models/concerns/adjustment_scopes.rb b/app/models/concerns/adjustment_scopes.rb index 927e9e8c1c..18e21fccec 100644 --- a/app/models/concerns/adjustment_scopes.rb +++ b/app/models/concerns/adjustment_scopes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module AdjustmentScopes extend ActiveSupport::Concern diff --git a/app/models/concerns/order_shipment.rb b/app/models/concerns/order_shipment.rb index 1f9c937bb5..267edf64f4 100644 --- a/app/models/concerns/order_shipment.rb +++ b/app/models/concerns/order_shipment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'active_support/concern' # This module is an adapter for OFN to work with Spree 2 code. diff --git a/app/models/concerns/product_stock.rb b/app/models/concerns/product_stock.rb index 60e98d7791..9ca52370fc 100644 --- a/app/models/concerns/product_stock.rb +++ b/app/models/concerns/product_stock.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'active_support/concern' module ProductStock diff --git a/app/models/concerns/stock_settings_override_validation.rb b/app/models/concerns/stock_settings_override_validation.rb index b548a8b64b..7040cb50e0 100644 --- a/app/models/concerns/stock_settings_override_validation.rb +++ b/app/models/concerns/stock_settings_override_validation.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Validates the combination of on_demand and count_on_hand values. # # `on_demand` can have three values: true, false or nil diff --git a/app/models/concerns/variant_stock.rb b/app/models/concerns/variant_stock.rb index 1fd816bc8c..81e9383727 100644 --- a/app/models/concerns/variant_stock.rb +++ b/app/models/concerns/variant_stock.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'active_support/concern' # These methods were available in Spree 1, but were removed in Spree 2. We diff --git a/app/models/content_configuration.rb b/app/models/content_configuration.rb index a645738f34..0f34598cd7 100644 --- a/app/models/content_configuration.rb +++ b/app/models/content_configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/paperclippable' class ContentConfiguration < Spree::Preferences::FileConfiguration diff --git a/app/models/coordinator_fee.rb b/app/models/coordinator_fee.rb index 92238cbebe..b308c611b1 100644 --- a/app/models/coordinator_fee.rb +++ b/app/models/coordinator_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CoordinatorFee < ApplicationRecord belongs_to :order_cycle belongs_to :enterprise_fee diff --git a/app/models/customer.rb b/app/models/customer.rb index 317eb4ba75..a3baf79e6d 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Customer < ApplicationRecord acts_as_taggable diff --git a/app/models/distributor_shipping_method.rb b/app/models/distributor_shipping_method.rb index 87aba1b139..ebce5682bc 100644 --- a/app/models/distributor_shipping_method.rb +++ b/app/models/distributor_shipping_method.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DistributorShippingMethod < ApplicationRecord self.table_name = "distributors_shipping_methods" belongs_to :shipping_method, class_name: "Spree::ShippingMethod", touch: true diff --git a/app/models/enterprise_fee.rb b/app/models/enterprise_fee.rb index e2563203c9..91b262e279 100644 --- a/app/models/enterprise_fee.rb +++ b/app/models/enterprise_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EnterpriseFee < ApplicationRecord include Spree::Core::CalculatedAdjustments diff --git a/app/models/enterprise_relationship_permission.rb b/app/models/enterprise_relationship_permission.rb index 55d70d57a8..33bf4a2fe2 100644 --- a/app/models/enterprise_relationship_permission.rb +++ b/app/models/enterprise_relationship_permission.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EnterpriseRelationshipPermission < ApplicationRecord default_scope { order('name') } end diff --git a/app/models/enterprise_role.rb b/app/models/enterprise_role.rb index e48683be43..9b9290cf92 100644 --- a/app/models/enterprise_role.rb +++ b/app/models/enterprise_role.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class EnterpriseRole < ApplicationRecord belongs_to :user, class_name: Spree.user_class.to_s belongs_to :enterprise diff --git a/app/models/exchange.rb b/app/models/exchange.rb index 2cbb1e6928..a315ccd1c6 100644 --- a/app/models/exchange.rb +++ b/app/models/exchange.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Representation of an enterprise being part of an order cycle. # # A producer can be part as supplier. The supplier's products can be selected to diff --git a/app/models/exchange_fee.rb b/app/models/exchange_fee.rb index 7d9fa49269..e2eda0d611 100644 --- a/app/models/exchange_fee.rb +++ b/app/models/exchange_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ExchangeFee < ApplicationRecord belongs_to :exchange belongs_to :enterprise_fee diff --git a/app/models/exchange_variant.rb b/app/models/exchange_variant.rb index 01b792734e..46ef647f89 100644 --- a/app/models/exchange_variant.rb +++ b/app/models/exchange_variant.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ExchangeVariant < ApplicationRecord belongs_to :exchange belongs_to :variant, class_name: 'Spree::Variant' diff --git a/app/models/inventory_item.rb b/app/models/inventory_item.rb index fb20c15f84..601172999d 100644 --- a/app/models/inventory_item.rb +++ b/app/models/inventory_item.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class InventoryItem < ApplicationRecord belongs_to :enterprise belongs_to :variant, class_name: "Spree::Variant" diff --git a/app/models/order_cycle.rb b/app/models/order_cycle.rb index 37073c3628..e4e2c26106 100644 --- a/app/models/order_cycle.rb +++ b/app/models/order_cycle.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/scope_variant_to_hub' class OrderCycle < ApplicationRecord diff --git a/app/models/preference_sections/footer_and_external_links_section.rb b/app/models/preference_sections/footer_and_external_links_section.rb index cf9d926553..e2105bf3b8 100644 --- a/app/models/preference_sections/footer_and_external_links_section.rb +++ b/app/models/preference_sections/footer_and_external_links_section.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PreferenceSections class FooterAndExternalLinksSection def name diff --git a/app/models/preference_sections/group_signup_page_section.rb b/app/models/preference_sections/group_signup_page_section.rb index b28570fcd6..6ef026111c 100644 --- a/app/models/preference_sections/group_signup_page_section.rb +++ b/app/models/preference_sections/group_signup_page_section.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PreferenceSections class GroupSignupPageSection def name diff --git a/app/models/preference_sections/header_section.rb b/app/models/preference_sections/header_section.rb index 87e09d6e03..fda25ec075 100644 --- a/app/models/preference_sections/header_section.rb +++ b/app/models/preference_sections/header_section.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PreferenceSections class HeaderSection def name diff --git a/app/models/preference_sections/home_page_section.rb b/app/models/preference_sections/home_page_section.rb index b050322689..0591e834c6 100644 --- a/app/models/preference_sections/home_page_section.rb +++ b/app/models/preference_sections/home_page_section.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PreferenceSections class HomePageSection def name diff --git a/app/models/preference_sections/hub_signup_page_section.rb b/app/models/preference_sections/hub_signup_page_section.rb index 3c80e3ebff..d8ee08cb9f 100644 --- a/app/models/preference_sections/hub_signup_page_section.rb +++ b/app/models/preference_sections/hub_signup_page_section.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PreferenceSections class HubSignupPageSection def name diff --git a/app/models/preference_sections/main_links_section.rb b/app/models/preference_sections/main_links_section.rb index b23833650f..9190483efc 100644 --- a/app/models/preference_sections/main_links_section.rb +++ b/app/models/preference_sections/main_links_section.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PreferenceSections class MainLinksSection def name diff --git a/app/models/preference_sections/producer_signup_page_section.rb b/app/models/preference_sections/producer_signup_page_section.rb index bf96894c53..3633f1149e 100644 --- a/app/models/preference_sections/producer_signup_page_section.rb +++ b/app/models/preference_sections/producer_signup_page_section.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PreferenceSections class ProducerSignupPageSection def name diff --git a/app/models/preference_sections/user_guide_section.rb b/app/models/preference_sections/user_guide_section.rb index 4c1323959f..05820bf226 100644 --- a/app/models/preference_sections/user_guide_section.rb +++ b/app/models/preference_sections/user_guide_section.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PreferenceSections class UserGuideSection def name diff --git a/app/models/producer_property.rb b/app/models/producer_property.rb index 1d3ba6eb0e..171601cfa3 100644 --- a/app/models/producer_property.rb +++ b/app/models/producer_property.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ProducerProperty < ApplicationRecord belongs_to :producer, class_name: 'Enterprise', touch: true belongs_to :property, class_name: 'Spree::Property' diff --git a/app/models/product_import/entry_processor.rb b/app/models/product_import/entry_processor.rb index 9c53dfbb1d..71bbb1548f 100644 --- a/app/models/product_import/entry_processor.rb +++ b/app/models/product_import/entry_processor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This class handles the saving of new product, variant, and inventory records created during # product import. It also collates data regarding this process for user feedback, as the import # is processed in small stages sequentially over a number of requests. diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index 34eed64fdf..debc68fb64 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This class handles a number of custom validation processes that take place during product import, # as a spreadsheet entry is checked to see if it is a valid product, variant, or inventory item. # It also handles error messages and user feedback for the validation process. diff --git a/app/models/product_import/inventory_reset_strategy.rb b/app/models/product_import/inventory_reset_strategy.rb index 9be02965c9..826f0d032c 100644 --- a/app/models/product_import/inventory_reset_strategy.rb +++ b/app/models/product_import/inventory_reset_strategy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ProductImport class InventoryResetStrategy def initialize(excluded_items_ids) diff --git a/app/models/product_import/product_importer.rb b/app/models/product_import/product_importer.rb index 75e9d78846..f5464f7e6b 100644 --- a/app/models/product_import/product_importer.rb +++ b/app/models/product_import/product_importer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This is the main class for product import. It handles the initial processing of the CSV file, # and begins the processing of the spreadsheet entries by the other product import classes. # As spreadsheets can contain any number of entries (1000+), the import is split into smaller chunks diff --git a/app/models/product_import/reset_absent.rb b/app/models/product_import/reset_absent.rb index 5226b5a6d4..f53ab0b444 100644 --- a/app/models/product_import/reset_absent.rb +++ b/app/models/product_import/reset_absent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ProductImport class ResetAbsent def initialize(entry_processor, settings, reset_stock_strategy) diff --git a/app/models/product_import/settings.rb b/app/models/product_import/settings.rb index c0028138f8..ee22f218be 100644 --- a/app/models/product_import/settings.rb +++ b/app/models/product_import/settings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ProductImport class Settings def initialize(import_settings) diff --git a/app/models/product_import/spreadsheet_data.rb b/app/models/product_import/spreadsheet_data.rb index 79f1d0df92..99a46fbfd0 100644 --- a/app/models/product_import/spreadsheet_data.rb +++ b/app/models/product_import/spreadsheet_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This class encapsulates a number of "indexes" used during product import. These contain hashes # of information that need to be accessed at various stages of the import, and are built in order # to minimise the number of queries that take place. So for instance, if a spreadsheet has 4000 diff --git a/app/models/product_import/spreadsheet_entry.rb b/app/models/product_import/spreadsheet_entry.rb index c8122e4cb8..14759b6ea7 100644 --- a/app/models/product_import/spreadsheet_entry.rb +++ b/app/models/product_import/spreadsheet_entry.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Objects of this class represent a line from a spreadsheet that will be processed and used # to create either product, variant, or inventory records. These objects are referred to as # "entry" or "entries" throughout product import. diff --git a/app/models/product_import/unit_converter.rb b/app/models/product_import/unit_converter.rb index c5321a4990..a7434912b3 100644 --- a/app/models/product_import/unit_converter.rb +++ b/app/models/product_import/unit_converter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This class handles conversion of human-readable unit weights for products/variants into # the non-human-readable format needed by the database. The table below shows how fields # from a spreadsheet (left) become database fields (right): diff --git a/app/models/proxy_order.rb b/app/models/proxy_order.rb index a64836b09c..484c76faf8 100644 --- a/app/models/proxy_order.rb +++ b/app/models/proxy_order.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Each Subscription has many ProxyOrders, one for each OrderCycle to which the Subscription applies # Proxy pattern allows for deferral of initialization until absolutely required # This reduces the need to keep Orders in sync with their parent Subscriptions diff --git a/app/models/schedule.rb b/app/models/schedule.rb index ee0429fa07..164e3ae4bc 100644 --- a/app/models/schedule.rb +++ b/app/models/schedule.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Schedule < ApplicationRecord has_paper_trail meta: { custom_data: proc { |schedule| schedule.order_cycle_ids.to_s } } diff --git a/app/models/spree/gateway/stripe_connect.rb b/app/models/spree/gateway/stripe_connect.rb index af341ac3aa..fdd1d25a99 100644 --- a/app/models/spree/gateway/stripe_connect.rb +++ b/app/models/spree/gateway/stripe_connect.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'stripe/profile_storer' module Spree diff --git a/app/models/spree/preferences/file_configuration.rb b/app/models/spree/preferences/file_configuration.rb index 278a76adf9..7015e60296 100644 --- a/app/models/spree/preferences/file_configuration.rb +++ b/app/models/spree/preferences/file_configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module Preferences class FileConfiguration < Configuration diff --git a/app/models/spree/property.rb b/app/models/spree/property.rb index 900519aa6c..3762c3b393 100644 --- a/app/models/spree/property.rb +++ b/app/models/spree/property.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree class Property < ApplicationRecord has_many :product_properties, dependent: :destroy diff --git a/app/models/spree/user.rb b/app/models/spree/user.rb index af0351e0d7..f7efda3b35 100644 --- a/app/models/spree/user.rb +++ b/app/models/spree/user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree class User < ApplicationRecord devise :database_authenticatable, :token_authenticatable, :registerable, :recoverable, diff --git a/app/models/stripe_account.rb b/app/models/stripe_account.rb index 2065bc14ec..5eaeb4f3f4 100644 --- a/app/models/stripe_account.rb +++ b/app/models/stripe_account.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class StripeAccount < ApplicationRecord belongs_to :enterprise validates :stripe_user_id, :stripe_publishable_key, presence: true diff --git a/app/models/subscription.rb b/app/models/subscription.rb index b8352ea9f7..d6278cd837 100644 --- a/app/models/subscription.rb +++ b/app/models/subscription.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Subscription < ApplicationRecord ALLOWED_PAYMENT_METHOD_TYPES = ["Spree::PaymentMethod::Check", "Spree::Gateway::StripeConnect", diff --git a/app/models/subscription_line_item.rb b/app/models/subscription_line_item.rb index 795d5996ce..31a9450ea3 100644 --- a/app/models/subscription_line_item.rb +++ b/app/models/subscription_line_item.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SubscriptionLineItem < ApplicationRecord belongs_to :subscription, inverse_of: :subscription_line_items belongs_to :variant, -> { with_deleted }, class_name: 'Spree::Variant' diff --git a/app/models/tag_rule.rb b/app/models/tag_rule.rb index 6f61d4a31a..b1d5b83ef9 100644 --- a/app/models/tag_rule.rb +++ b/app/models/tag_rule.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagRule < ApplicationRecord belongs_to :enterprise diff --git a/app/models/tag_rule/filter_order_cycles.rb b/app/models/tag_rule/filter_order_cycles.rb index fd467a1658..c9048593f6 100644 --- a/app/models/tag_rule/filter_order_cycles.rb +++ b/app/models/tag_rule/filter_order_cycles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagRule::FilterOrderCycles < TagRule preference :matched_order_cycles_visibility, :string, default: "visible" preference :exchange_tags, :string, default: "" diff --git a/app/models/tag_rule/filter_payment_methods.rb b/app/models/tag_rule/filter_payment_methods.rb index 11d5b5e737..6bcf2709ef 100644 --- a/app/models/tag_rule/filter_payment_methods.rb +++ b/app/models/tag_rule/filter_payment_methods.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagRule::FilterPaymentMethods < TagRule preference :matched_payment_methods_visibility, :string, default: "visible" preference :payment_method_tags, :string, default: "" diff --git a/app/models/tag_rule/filter_products.rb b/app/models/tag_rule/filter_products.rb index 40035a21d5..20ff29bfc9 100644 --- a/app/models/tag_rule/filter_products.rb +++ b/app/models/tag_rule/filter_products.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagRule class FilterProducts < TagRule preference :matched_variants_visibility, :string, default: "visible" diff --git a/app/models/tag_rule/filter_shipping_methods.rb b/app/models/tag_rule/filter_shipping_methods.rb index a5de92da8b..43b58a2052 100644 --- a/app/models/tag_rule/filter_shipping_methods.rb +++ b/app/models/tag_rule/filter_shipping_methods.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TagRule::FilterShippingMethods < TagRule preference :matched_shipping_methods_visibility, :string, default: "visible" preference :shipping_method_tags, :string, default: "" diff --git a/app/serializers/api/address_serializer.rb b/app/serializers/api/address_serializer.rb index 4ef6d7d790..acc986d5f7 100644 --- a/app/serializers/api/address_serializer.rb +++ b/app/serializers/api/address_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::AddressSerializer < ActiveModel::Serializer # cached # delegate :cache_key, to: :object diff --git a/app/serializers/api/adjustment_serializer.rb b/app/serializers/api/adjustment_serializer.rb index 44fa26f227..741e3699a4 100644 --- a/app/serializers/api/adjustment_serializer.rb +++ b/app/serializers/api/adjustment_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class AdjustmentSerializer < ActiveModel::Serializer attributes :id, :amount, :label, :eligible, diff --git a/app/serializers/api/cached_enterprise_serializer.rb b/app/serializers/api/cached_enterprise_serializer.rb index 7c091b51c9..cec5388204 100644 --- a/app/serializers/api/cached_enterprise_serializer.rb +++ b/app/serializers/api/cached_enterprise_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/property_merge' module Api diff --git a/app/serializers/api/country_serializer.rb b/app/serializers/api/country_serializer.rb index 8a7bca33de..8516328d5a 100644 --- a/app/serializers/api/country_serializer.rb +++ b/app/serializers/api/country_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::CountrySerializer < ActiveModel::Serializer attributes :id, :name, :states diff --git a/app/serializers/api/credit_card_serializer.rb b/app/serializers/api/credit_card_serializer.rb index bab0f5bc8d..d7ac10d001 100644 --- a/app/serializers/api/credit_card_serializer.rb +++ b/app/serializers/api/credit_card_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class CreditCardSerializer < ActiveModel::Serializer attributes :id, :brand, :number, :expiry, :formatted, :delete_link, :is_default diff --git a/app/serializers/api/currency_config_serializer.rb b/app/serializers/api/currency_config_serializer.rb index ac87f6d9a1..a9b1bbd7f1 100644 --- a/app/serializers/api/currency_config_serializer.rb +++ b/app/serializers/api/currency_config_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::CurrencyConfigSerializer < ActiveModel::Serializer attributes :currency, :display_currency, :symbol, :symbol_position, :hide_cents diff --git a/app/serializers/api/current_order_serializer.rb b/app/serializers/api/current_order_serializer.rb index 2ec8d4e541..9860f64821 100644 --- a/app/serializers/api/current_order_serializer.rb +++ b/app/serializers/api/current_order_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::CurrentOrderSerializer < ActiveModel::Serializer attributes :id, :item_total, :email, :shipping_method_id, :display_total, :payment_method_id diff --git a/app/serializers/api/customer_serializer.rb b/app/serializers/api/customer_serializer.rb index 1c437a987e..053313cb30 100644 --- a/app/serializers/api/customer_serializer.rb +++ b/app/serializers/api/customer_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class CustomerSerializer < ActiveModel::Serializer attributes :id, :enterprise_id, :name, :code, :email, :allow_charges diff --git a/app/serializers/api/enterprise_serializer.rb b/app/serializers/api/enterprise_serializer.rb index 94dbda5ada..ef1c73762b 100644 --- a/app/serializers/api/enterprise_serializer.rb +++ b/app/serializers/api/enterprise_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/property_merge' class Api::EnterpriseSerializer < ActiveModel::Serializer diff --git a/app/serializers/api/enterprise_shopfront_list_serializer.rb b/app/serializers/api/enterprise_shopfront_list_serializer.rb index f636c239cb..8cd95c1547 100644 --- a/app/serializers/api/enterprise_shopfront_list_serializer.rb +++ b/app/serializers/api/enterprise_shopfront_list_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Represents the minimum details of an Enterprise when all shopfronts are being listed module Api class EnterpriseShopfrontListSerializer < ActiveModel::Serializer diff --git a/app/serializers/api/enterprise_shopfront_serializer.rb b/app/serializers/api/enterprise_shopfront_serializer.rb index 035f8fde51..9707356799 100644 --- a/app/serializers/api/enterprise_shopfront_serializer.rb +++ b/app/serializers/api/enterprise_shopfront_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Represents the properties of an Enterprise when viewing the details of listed shopfronts module Api class EnterpriseShopfrontSerializer < ActiveModel::Serializer diff --git a/app/serializers/api/enterprise_thin_serializer.rb b/app/serializers/api/enterprise_thin_serializer.rb index cdc4d6b9eb..956ec20d05 100644 --- a/app/serializers/api/enterprise_thin_serializer.rb +++ b/app/serializers/api/enterprise_thin_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class EnterpriseThinSerializer < ActiveModel::Serializer attributes :name, :id, :active, :path diff --git a/app/serializers/api/group_list_serializer.rb b/app/serializers/api/group_list_serializer.rb index 46e851ab4f..420255b287 100644 --- a/app/serializers/api/group_list_serializer.rb +++ b/app/serializers/api/group_list_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class GroupListSerializer < ActiveModel::Serializer attributes :id, :name, :permalink, :email, :website, :facebook, :instagram, diff --git a/app/serializers/api/id_name_serializer.rb b/app/serializers/api/id_name_serializer.rb index 1db5f2439e..e49c8705e6 100644 --- a/app/serializers/api/id_name_serializer.rb +++ b/app/serializers/api/id_name_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::IdNameSerializer < ActiveModel::Serializer attributes :id, :name end diff --git a/app/serializers/api/id_serializer.rb b/app/serializers/api/id_serializer.rb index 0093338e6e..617d58d197 100644 --- a/app/serializers/api/id_serializer.rb +++ b/app/serializers/api/id_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::IdSerializer < ActiveModel::Serializer attributes :id end diff --git a/app/serializers/api/image_serializer.rb b/app/serializers/api/image_serializer.rb index 70c62b397a..ead54697d6 100644 --- a/app/serializers/api/image_serializer.rb +++ b/app/serializers/api/image_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::ImageSerializer < ActiveModel::Serializer attributes :id, :alt, :thumb_url, :small_url, :image_url, :large_url diff --git a/app/serializers/api/line_item_serializer.rb b/app/serializers/api/line_item_serializer.rb index f8022caef3..0f2196e083 100644 --- a/app/serializers/api/line_item_serializer.rb +++ b/app/serializers/api/line_item_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::LineItemSerializer < ActiveModel::Serializer attributes :id, :quantity, :max_quantity, :price, :order_id diff --git a/app/serializers/api/order_cycle_serializer.rb b/app/serializers/api/order_cycle_serializer.rb index f01d79a931..25ef75d29f 100644 --- a/app/serializers/api/order_cycle_serializer.rb +++ b/app/serializers/api/order_cycle_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class OrderCycleSerializer < ActiveModel::Serializer attributes :order_cycle_id, :orders_close_at diff --git a/app/serializers/api/order_detailed_serializer.rb b/app/serializers/api/order_detailed_serializer.rb index fd625b6936..1343a57edd 100644 --- a/app/serializers/api/order_detailed_serializer.rb +++ b/app/serializers/api/order_detailed_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class OrderDetailedSerializer < Api::Admin::OrderSerializer has_one :shipping_method, serializer: Api::ShippingMethodSerializer diff --git a/app/serializers/api/order_serializer.rb b/app/serializers/api/order_serializer.rb index 3123b973a9..b4a9460ce3 100644 --- a/app/serializers/api/order_serializer.rb +++ b/app/serializers/api/order_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class OrderSerializer < ActiveModel::Serializer attributes :number, :completed_at, :total, :state, :shipment_state, :payment_state, diff --git a/app/serializers/api/payment_method_serializer.rb b/app/serializers/api/payment_method_serializer.rb index a135f5d792..8ee984de10 100644 --- a/app/serializers/api/payment_method_serializer.rb +++ b/app/serializers/api/payment_method_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::PaymentMethodSerializer < ActiveModel::Serializer attributes :name, :description, :id, :method_type, :price diff --git a/app/serializers/api/payment_serializer.rb b/app/serializers/api/payment_serializer.rb index 033803faf9..8d8e365882 100644 --- a/app/serializers/api/payment_serializer.rb +++ b/app/serializers/api/payment_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class PaymentSerializer < ActiveModel::Serializer attributes :amount, :updated_at, :payment_method, :state, :cvv_response_message diff --git a/app/serializers/api/product_serializer.rb b/app/serializers/api/product_serializer.rb index 994df3bd52..b37bc78366 100644 --- a/app/serializers/api/product_serializer.rb +++ b/app/serializers/api/product_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open_food_network/scope_variant_to_hub" class Api::ProductSerializer < ActiveModel::Serializer diff --git a/app/serializers/api/property_serializer.rb b/app/serializers/api/property_serializer.rb index cdb3f2bae3..6255ba2602 100644 --- a/app/serializers/api/property_serializer.rb +++ b/app/serializers/api/property_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::PropertySerializer < ActiveModel::Serializer attributes :id, :name, :presentation diff --git a/app/serializers/api/rails_flash_serializer.rb b/app/serializers/api/rails_flash_serializer.rb index ea7912b1e7..212aeebde7 100644 --- a/app/serializers/api/rails_flash_serializer.rb +++ b/app/serializers/api/rails_flash_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class RailsFlashSerializer < ActiveModel::Serializer attributes :info, :success, :error, :notice diff --git a/app/serializers/api/shipment_serializer.rb b/app/serializers/api/shipment_serializer.rb index 71fc27450b..1c03d9eb5e 100644 --- a/app/serializers/api/shipment_serializer.rb +++ b/app/serializers/api/shipment_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class ShipmentSerializer < ActiveModel::Serializer attributes :id, :tracking, :number, :order_id, :cost, :shipped_at, :stock_location_name, :state diff --git a/app/serializers/api/shipping_method_serializer.rb b/app/serializers/api/shipping_method_serializer.rb index 26e6b71201..66f48a151a 100644 --- a/app/serializers/api/shipping_method_serializer.rb +++ b/app/serializers/api/shipping_method_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::ShippingMethodSerializer < ActiveModel::Serializer attributes :id, :require_ship_address, :name, :description, :price diff --git a/app/serializers/api/shop_for_orders_serializer.rb b/app/serializers/api/shop_for_orders_serializer.rb index 1b8fa51b85..a8dc799012 100644 --- a/app/serializers/api/shop_for_orders_serializer.rb +++ b/app/serializers/api/shop_for_orders_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class ShopForOrdersSerializer < ActiveModel::Serializer attributes :id, :name, :hash, :logo diff --git a/app/serializers/api/state_serializer.rb b/app/serializers/api/state_serializer.rb index 2862c24468..7d839e0bcc 100644 --- a/app/serializers/api/state_serializer.rb +++ b/app/serializers/api/state_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::StateSerializer < ActiveModel::Serializer attributes :id, :name, :abbr, :country_id end diff --git a/app/serializers/api/taxon_jstree_attribute_serializer.rb b/app/serializers/api/taxon_jstree_attribute_serializer.rb index abf10d406d..3fff38e11e 100644 --- a/app/serializers/api/taxon_jstree_attribute_serializer.rb +++ b/app/serializers/api/taxon_jstree_attribute_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class TaxonJstreeAttributeSerializer < ActiveModel::Serializer attributes :id, :name diff --git a/app/serializers/api/taxon_jstree_serializer.rb b/app/serializers/api/taxon_jstree_serializer.rb index cd457c644b..6f862dc404 100644 --- a/app/serializers/api/taxon_jstree_serializer.rb +++ b/app/serializers/api/taxon_jstree_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class TaxonJstreeSerializer < ActiveModel::Serializer attributes :data, :state diff --git a/app/serializers/api/taxon_serializer.rb b/app/serializers/api/taxon_serializer.rb index 43d3ddefd9..38eb2bf3dd 100644 --- a/app/serializers/api/taxon_serializer.rb +++ b/app/serializers/api/taxon_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::TaxonSerializer < ActiveModel::Serializer cached delegate :cache_key, to: :object diff --git a/app/serializers/api/uncached_enterprise_serializer.rb b/app/serializers/api/uncached_enterprise_serializer.rb index 1bbae872ba..fb6b478a28 100644 --- a/app/serializers/api/uncached_enterprise_serializer.rb +++ b/app/serializers/api/uncached_enterprise_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class UncachedEnterpriseSerializer < ActiveModel::Serializer include SerializerHelper diff --git a/app/serializers/api/user_serializer.rb b/app/serializers/api/user_serializer.rb index 3d9e64e956..e0bd297972 100644 --- a/app/serializers/api/user_serializer.rb +++ b/app/serializers/api/user_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Api class UserSerializer < ActiveModel::Serializer attributes :id, :email diff --git a/app/serializers/api/variant_serializer.rb b/app/serializers/api/variant_serializer.rb index 65a6d185e5..3c2ede89ae 100644 --- a/app/serializers/api/variant_serializer.rb +++ b/app/serializers/api/variant_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Api::VariantSerializer < ActiveModel::Serializer attributes :id, :is_master, :product_name, :sku, :options_text, :unit_value, :unit_description, :unit_to_display, diff --git a/app/services/bulk_invoice_service.rb b/app/services/bulk_invoice_service.rb index 6776ad448a..dc1b31f17d 100644 --- a/app/services/bulk_invoice_service.rb +++ b/app/services/bulk_invoice_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class BulkInvoiceService attr_reader :id diff --git a/app/services/cart_service.rb b/app/services/cart_service.rb index 256efcb96b..a405b41d44 100644 --- a/app/services/cart_service.rb +++ b/app/services/cart_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/scope_variant_to_hub' # Previously Spree::OrderPopulator. Modified to work with max_quantity and variant overrides. diff --git a/app/services/create_order_cycle.rb b/app/services/create_order_cycle.rb index a7c631991e..c8f9ce1b18 100644 --- a/app/services/create_order_cycle.rb +++ b/app/services/create_order_cycle.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Creates an order cycle for the provided enterprise and selecting all the # variants specified for both incoming and outgoing exchanges class CreateOrderCycle diff --git a/app/services/current_order_locker.rb b/app/services/current_order_locker.rb index e88832e17a..fe47eebddb 100644 --- a/app/services/current_order_locker.rb +++ b/app/services/current_order_locker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Locks a controller's current order including its variants. # # It should be used when making major changes like checking out the order. diff --git a/app/services/default_country.rb b/app/services/default_country.rb index c805e261b0..11b85e90a4 100644 --- a/app/services/default_country.rb +++ b/app/services/default_country.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DefaultCountry def self.id country.id diff --git a/app/services/default_shipping_category.rb b/app/services/default_shipping_category.rb index 8e0a7b90ae..38a2df77a6 100644 --- a/app/services/default_shipping_category.rb +++ b/app/services/default_shipping_category.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + # Encapsulates the concept of default stock location in creation of a product or a shipping method. class DefaultShippingCategory - NAME = 'Default'.freeze + NAME = 'Default' def self.create! Spree::ShippingCategory.create!(name: NAME) diff --git a/app/services/default_stock_location.rb b/app/services/default_stock_location.rb index 3a0a3bf8b4..0b79f446ec 100644 --- a/app/services/default_stock_location.rb +++ b/app/services/default_stock_location.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + # Encapsulates the concept of default stock location that OFN has, as explained # in https://github.com/openfoodfoundation/openfoodnetwork/wiki/Spree-Upgrade%3A-Stock-locations class DefaultStockLocation - NAME = 'default'.freeze + NAME = 'default' def self.create! country = Spree::Country.find_by(iso: ENV['DEFAULT_COUNTRY_CODE']) diff --git a/app/services/embedded_page_service.rb b/app/services/embedded_page_service.rb index f2d6021e20..8468992167 100644 --- a/app/services/embedded_page_service.rb +++ b/app/services/embedded_page_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Processes requests for pages embedded in iframes class EmbeddedPageService diff --git a/app/services/exchange_variant_bulk_updater.rb b/app/services/exchange_variant_bulk_updater.rb index a617649c81..3e5345fff2 100644 --- a/app/services/exchange_variant_bulk_updater.rb +++ b/app/services/exchange_variant_bulk_updater.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ExchangeVariantBulkUpdater def initialize(exchange) @exchange = exchange diff --git a/app/services/exchange_variant_deleter.rb b/app/services/exchange_variant_deleter.rb index 190b318711..0db1abd884 100644 --- a/app/services/exchange_variant_deleter.rb +++ b/app/services/exchange_variant_deleter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ExchangeVariantDeleter def delete(product) ExchangeVariant. diff --git a/app/services/invoice_renderer.rb b/app/services/invoice_renderer.rb index 956550d51b..78dbe3938b 100644 --- a/app/services/invoice_renderer.rb +++ b/app/services/invoice_renderer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class InvoiceRenderer def initialize(renderer = ApplicationController.new) @renderer = renderer diff --git a/app/services/line_item_syncer.rb b/app/services/line_item_syncer.rb index 68b86d6a97..c50341f803 100644 --- a/app/services/line_item_syncer.rb +++ b/app/services/line_item_syncer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Responsible for keeping line items on initialised orders for a subscription in sync with # the subscription line items on that subscription. diff --git a/app/services/mail_configuration.rb b/app/services/mail_configuration.rb index e8b6f81aac..5a06fda324 100644 --- a/app/services/mail_configuration.rb +++ b/app/services/mail_configuration.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Configures Rails to use the specified mail configuration # by setting entries on the Spree Config # and initializing Spree:MailSettings that uses the Spree::Config. diff --git a/app/services/order_adjustments_fetcher.rb b/app/services/order_adjustments_fetcher.rb index 09618b60f4..6f236074b9 100644 --- a/app/services/order_adjustments_fetcher.rb +++ b/app/services/order_adjustments_fetcher.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This class allows orders with eager-loaded adjustment objects to calculate various adjustment # types without triggering additional queries. # diff --git a/app/services/order_cycle_distributed_products.rb b/app/services/order_cycle_distributed_products.rb index 5b6b0d9412..afe47b6cf7 100644 --- a/app/services/order_cycle_distributed_products.rb +++ b/app/services/order_cycle_distributed_products.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Returns a (paginatable) AR object for the products or variants in stock for a given shop and OC. # The stock-checking includes on_demand and stock level overrides from variant_overrides. class OrderCycleDistributedProducts diff --git a/app/services/order_cycle_distributed_variants.rb b/app/services/order_cycle_distributed_variants.rb index 6a53b7a092..1b5c64c83e 100644 --- a/app/services/order_cycle_distributed_variants.rb +++ b/app/services/order_cycle_distributed_variants.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class OrderCycleDistributedVariants def initialize(order_cycle, distributor) @order_cycle = order_cycle diff --git a/app/services/order_cycle_form.rb b/app/services/order_cycle_form.rb index 87292a8a0c..6e96b9af68 100644 --- a/app/services/order_cycle_form.rb +++ b/app/services/order_cycle_form.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/permissions' require 'open_food_network/order_cycle_form_applicator' require 'order_management/subscriptions/proxy_order_syncer' diff --git a/app/services/order_factory.rb b/app/services/order_factory.rb index e9613da79a..077dbac288 100644 --- a/app/services/order_factory.rb +++ b/app/services/order_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/scope_variant_to_hub' # Builds orders based on a set of attributes diff --git a/app/services/order_syncer.rb b/app/services/order_syncer.rb index 61b9407115..f7b38a3e7b 100644 --- a/app/services/order_syncer.rb +++ b/app/services/order_syncer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Responsible for ensuring that any updates to a Subscription are propagated to any # orders belonging to that Subscription which have been instantiated class OrderSyncer diff --git a/app/services/order_update_issues.rb b/app/services/order_update_issues.rb index e0389dbc5b..bcdf3c644e 100644 --- a/app/services/order_update_issues.rb +++ b/app/services/order_update_issues.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Wrapper for a hash of issues encountered by instances of OrderSyncer and LineItemSyncer # Used to report issues to the user when they attempt to update a subscription diff --git a/app/services/order_workflow.rb b/app/services/order_workflow.rb index 5872710577..a21ccc67f2 100644 --- a/app/services/order_workflow.rb +++ b/app/services/order_workflow.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class OrderWorkflow attr_reader :order diff --git a/app/services/permissions/order.rb b/app/services/permissions/order.rb index a0c084cf8e..3ee221aa88 100644 --- a/app/services/permissions/order.rb +++ b/app/services/permissions/order.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/permissions' module Permissions diff --git a/app/services/product_tag_rules_filterer.rb b/app/services/product_tag_rules_filterer.rb index fcb678a672..50b6168dc6 100644 --- a/app/services/product_tag_rules_filterer.rb +++ b/app/services/product_tag_rules_filterer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Takes a Spree::Variant AR object and filters results based on applicable tag rules. # Tag rules exists in the context of enterprise, customer, and variant_overrides, # and are applied to variant_overrides only. Returns a Spree::Variant AR object. diff --git a/app/services/products_renderer.rb b/app/services/products_renderer.rb index 963330dba8..b53c868d97 100644 --- a/app/services/products_renderer.rb +++ b/app/services/products_renderer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/scope_product_to_hub' class ProductsRenderer diff --git a/app/services/search_orders.rb b/app/services/search_orders.rb index 8e96cfbfa0..3e17a8bed3 100644 --- a/app/services/search_orders.rb +++ b/app/services/search_orders.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SearchOrders attr_reader :orders diff --git a/app/services/tax_rate_finder.rb b/app/services/tax_rate_finder.rb index de16839044..59d24dd052 100644 --- a/app/services/tax_rate_finder.rb +++ b/app/services/tax_rate_finder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Finds tax rates on which an adjustment is based on. # For example a packaging fee may contain VAT. This service finds the VAT rate # for the tax included in the packaging fee. diff --git a/app/services/terms_of_service.rb b/app/services/terms_of_service.rb index b2f89eeff1..dc84b14988 100644 --- a/app/services/terms_of_service.rb +++ b/app/services/terms_of_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TermsOfService def self.tos_accepted?(customer, distributor = nil) return false unless accepted_at = customer&.terms_and_conditions_accepted_at diff --git a/app/services/upload_sanitizer.rb b/app/services/upload_sanitizer.rb index 4f5fc2bb3a..83717557a4 100644 --- a/app/services/upload_sanitizer.rb +++ b/app/services/upload_sanitizer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Formats uploaded files to UTF-8 encoding and strips unexpected BOM characters. # Takes an open File object as input class UploadSanitizer diff --git a/app/services/variant_deleter.rb b/app/services/variant_deleter.rb index f499f0c24d..fb9637f780 100644 --- a/app/services/variant_deleter.rb +++ b/app/services/variant_deleter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Checks the validity of a soft-delete call. class VariantDeleter def delete(variant) diff --git a/app/services/variant_units/variant_and_line_item_naming.rb b/app/services/variant_units/variant_and_line_item_naming.rb index eb63975870..9980abe083 100644 --- a/app/services/variant_units/variant_and_line_item_naming.rb +++ b/app/services/variant_units/variant_and_line_item_naming.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This module is included in both the Spree::Variant and Spree::LineItem model decorators # It contains all of our logic for creating and naming option values (which are associated # with both models) and methods for printing human readable "names" for instances of these models. diff --git a/app/services/variants_stock_levels.rb b/app/services/variants_stock_levels.rb index a72abc8ffb..e76c1fef99 100644 --- a/app/services/variants_stock_levels.rb +++ b/app/services/variants_stock_levels.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Report the stock levels of: # - all variants in the order # - all requested variant ids diff --git a/app/validators/date_time_string_validator.rb b/app/validators/date_time_string_validator.rb index f1a4eccbfb..a70bf9a0c7 100644 --- a/app/validators/date_time_string_validator.rb +++ b/app/validators/date_time_string_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Validates a datetime string with relaxed rules # # This uses ActiveSupport::TimeZone.parse behind the scenes. diff --git a/app/validators/distributors_validator.rb b/app/validators/distributors_validator.rb index 845983429d..a4002210aa 100644 --- a/app/validators/distributors_validator.rb +++ b/app/validators/distributors_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This is workaround only for https://github.com/openfoodfoundation/openfoodnetwork/issues/1560#issuecomment-300832051 class DistributorsValidator < ActiveModel::Validator def validate(record) diff --git a/app/validators/integer_array_validator.rb b/app/validators/integer_array_validator.rb index 27042c972b..64f718a4d3 100644 --- a/app/validators/integer_array_validator.rb +++ b/app/validators/integer_array_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Validates an integer array # # This uses Integer() behind the scenes. diff --git a/engines/order_management/app/controllers/order_management/application_controller.rb b/engines/order_management/app/controllers/order_management/application_controller.rb index ba61b2290b..7834901f27 100644 --- a/engines/order_management/app/controllers/order_management/application_controller.rb +++ b/engines/order_management/app/controllers/order_management/application_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement class ApplicationController < ActionController::Base protect_from_forgery with: :exception diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/authorizer.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/authorizer.rb index 51b1393630..b85fdcbb6f 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/authorizer.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/authorizer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb index 0fda10c2f4..9d11b94d26 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This module provides EnterpriseFeeSummary::Scope DB result to report mappings for coordinator fees # in an order cycle. diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/exchange_order_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/exchange_order_fee.rb index c92d81c361..efef74fd11 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/exchange_order_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/exchange_order_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This module provides EnterpriseFeeSummary::Scope DB result to report mappings for exchange fees # that use order-based calculators. diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/incoming_exchange_line_item_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/incoming_exchange_line_item_fee.rb index 1bff07b5b0..2ab859a193 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/incoming_exchange_line_item_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/incoming_exchange_line_item_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This module provides EnterpriseFeeSummary::Scope DB result to report mappings for incoming # exchange fees that use line item -based calculators. diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/outgoing_exchange_line_item_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/outgoing_exchange_line_item_fee.rb index c4b997c774..3a547d659b 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/outgoing_exchange_line_item_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/outgoing_exchange_line_item_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This module provides EnterpriseFeeSummary::Scope DB result to report mappings for outgoing # exchange fees that use line item -based calculators. diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/payment_method_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/payment_method_fee.rb index ed0d30af1f..4fab78ad56 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/payment_method_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/payment_method_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This module provides EnterpriseFeeSummary::Scope DB result to report mappings for payment method # fees. diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/shipping_method_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/shipping_method_fee.rb index b96fd99e34..3863ff6d29 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/shipping_method_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/shipping_method_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This module provides EnterpriseFeeSummary::Scope DB result to report mappings for shipping method # fees. diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/using_enterprise_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/using_enterprise_fee.rb index c9c04477df..85e466c7ce 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/using_enterprise_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/using_enterprise_fee.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Different EnterpriseFeeSummary::Scope DB result attributes are checked when dealing with # enterprise fees that are attached to an order cycle in different ways. # diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/with_i18n.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/with_i18n.rb index 8440886020..92ce8859f5 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/with_i18n.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/with_i18n.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb index 938feeea75..d32f2492e0 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/permissions.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/permissions.rb index 95ce055f24..e518d0b89b 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/permissions.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/permissions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/csv_renderer.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/csv_renderer.rb index c4c8450485..253f904430 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/csv_renderer.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/csv_renderer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/html_renderer.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/html_renderer.rb index 23ed8f26ba..fa372fe893 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/html_renderer.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/renderers/html_renderer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total.rb index ca781af4e4..dddcd2ca46 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_service.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_service.rb index d0fd952161..43525fee87 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_service.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/report_service.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb index a3ed2fceb4..59a5cd0470 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/summarizer.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/summarizer.rb index 554c11999e..3f9b0098b5 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/summarizer.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/summarizer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OrderManagement module Reports module EnterpriseFeeSummary diff --git a/engines/order_management/app/services/reports.rb b/engines/order_management/app/services/reports.rb index ec85236122..5a25947ad7 100644 --- a/engines/order_management/app/services/reports.rb +++ b/engines/order_management/app/services/reports.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Reports class UnsupportedReportFormatException < StandardError; end end diff --git a/engines/order_management/app/services/reports/authorizer.rb b/engines/order_management/app/services/reports/authorizer.rb index 1f232b0160..2e58266579 100644 --- a/engines/order_management/app/services/reports/authorizer.rb +++ b/engines/order_management/app/services/reports/authorizer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Reports class Authorizer class ParameterNotAllowedError < StandardError; end diff --git a/engines/order_management/app/services/reports/parameters/base.rb b/engines/order_management/app/services/reports/parameters/base.rb index 31148fd47c..0a3490f914 100644 --- a/engines/order_management/app/services/reports/parameters/base.rb +++ b/engines/order_management/app/services/reports/parameters/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Reports module Parameters class Base diff --git a/engines/order_management/app/services/reports/permissions.rb b/engines/order_management/app/services/reports/permissions.rb index df8588670f..ebdfeacf24 100644 --- a/engines/order_management/app/services/reports/permissions.rb +++ b/engines/order_management/app/services/reports/permissions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Reports class Permissions attr_accessor :user diff --git a/engines/order_management/app/services/reports/renderers/base.rb b/engines/order_management/app/services/reports/renderers/base.rb index 73fda10231..3fb3a55f12 100644 --- a/engines/order_management/app/services/reports/renderers/base.rb +++ b/engines/order_management/app/services/reports/renderers/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Reports module Renderers class Base diff --git a/engines/order_management/app/services/reports/report_data/base.rb b/engines/order_management/app/services/reports/report_data/base.rb index a7d0595078..94fd55ac3f 100644 --- a/engines/order_management/app/services/reports/report_data/base.rb +++ b/engines/order_management/app/services/reports/report_data/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Reports module ReportData class Base diff --git a/engines/web/app/controllers/web/angular_templates_controller.rb b/engines/web/app/controllers/web/angular_templates_controller.rb index d8670a4664..75566fd108 100644 --- a/engines/web/app/controllers/web/angular_templates_controller.rb +++ b/engines/web/app/controllers/web/angular_templates_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Web class AngularTemplatesController < ApplicationController helper Web::Engine.helpers diff --git a/engines/web/app/controllers/web/application_controller.rb b/engines/web/app/controllers/web/application_controller.rb index 410b0ae531..32351f898d 100644 --- a/engines/web/app/controllers/web/application_controller.rb +++ b/engines/web/app/controllers/web/application_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Web class ApplicationController < ActionController::Base protect_from_forgery with: :exception diff --git a/engines/web/app/helpers/web/cookies_policy_helper.rb b/engines/web/app/helpers/web/cookies_policy_helper.rb index 0274b2d6c7..9ed4c47b73 100644 --- a/engines/web/app/helpers/web/cookies_policy_helper.rb +++ b/engines/web/app/helpers/web/cookies_policy_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Web module CookiesPolicyHelper def render_cookie_entry(cookie_name, cookie_desc, cookie_domain = nil) diff --git a/engines/web/lib/web/cookies_consent.rb b/engines/web/lib/web/cookies_consent.rb index 64f6c0c825..a2f085d520 100644 --- a/engines/web/lib/web/cookies_consent.rb +++ b/engines/web/lib/web/cookies_consent.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + module Web class CookiesConsent - COOKIE_NAME = 'cookies_consent'.freeze + COOKIE_NAME = 'cookies_consent' def initialize(cookies, domain) @cookies = cookies diff --git a/lib/discourse/single_sign_on.rb b/lib/discourse/single_sign_on.rb index 967e8b94a4..81264ce7f9 100644 --- a/lib/discourse/single_sign_on.rb +++ b/lib/discourse/single_sign_on.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This class is the reference implementation of a SSO provider from Discourse. module Discourse diff --git a/lib/open_food_network/address_finder.rb b/lib/open_food_network/address_finder.rb index c2313b9693..53b5290ff9 100644 --- a/lib/open_food_network/address_finder.rb +++ b/lib/open_food_network/address_finder.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Finds an address based on the data provided # Can take any combination of an email String, Customer or Spree::User as args # The #bill_address and #ship_address methods automatically return matched addresses diff --git a/lib/open_food_network/available_payment_method_filter.rb b/lib/open_food_network/available_payment_method_filter.rb index d42d4ae51b..f15714d1fb 100644 --- a/lib/open_food_network/available_payment_method_filter.rb +++ b/lib/open_food_network/available_payment_method_filter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class AvailablePaymentMethodFilter def filter!(payment_methods) diff --git a/lib/open_food_network/column_preference_defaults.rb b/lib/open_food_network/column_preference_defaults.rb index a79cfdd4c7..3f135f6b61 100644 --- a/lib/open_food_network/column_preference_defaults.rb +++ b/lib/open_food_network/column_preference_defaults.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork module ColumnPreferenceDefaults private diff --git a/lib/open_food_network/customers_report.rb b/lib/open_food_network/customers_report.rb index bd28e40533..0b3dd440c5 100644 --- a/lib/open_food_network/customers_report.rb +++ b/lib/open_food_network/customers_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class CustomersReport attr_reader :params diff --git a/lib/open_food_network/enterprise_fee_applicator.rb b/lib/open_food_network/enterprise_fee_applicator.rb index 24d3db29f9..e856ca3f8d 100644 --- a/lib/open_food_network/enterprise_fee_applicator.rb +++ b/lib/open_food_network/enterprise_fee_applicator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork EnterpriseFeeApplicator = Struct.new(:enterprise_fee, :variant, :role) do def create_line_item_adjustment(line_item) diff --git a/lib/open_food_network/enterprise_fee_calculator.rb b/lib/open_food_network/enterprise_fee_calculator.rb index 5300f8b89d..cfc66be18f 100644 --- a/lib/open_food_network/enterprise_fee_calculator.rb +++ b/lib/open_food_network/enterprise_fee_calculator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/enterprise_fee_applicator' module OpenFoodNetwork diff --git a/lib/open_food_network/enterprise_injection_data.rb b/lib/open_food_network/enterprise_injection_data.rb index 8fe9171ab8..31801c63f9 100644 --- a/lib/open_food_network/enterprise_injection_data.rb +++ b/lib/open_food_network/enterprise_injection_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class EnterpriseInjectionData def active_distributor_ids diff --git a/lib/open_food_network/enterprise_issue_validator.rb b/lib/open_food_network/enterprise_issue_validator.rb index 1d87f666f7..b69a7e6f36 100644 --- a/lib/open_food_network/enterprise_issue_validator.rb +++ b/lib/open_food_network/enterprise_issue_validator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class EnterpriseIssueValidator include Rails.application.routes.url_helpers diff --git a/lib/open_food_network/error_logger.rb b/lib/open_food_network/error_logger.rb index a1199c9e68..51ea1e715e 100644 --- a/lib/open_food_network/error_logger.rb +++ b/lib/open_food_network/error_logger.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Our error logging API currently wraps Bugsnag. # It makes us more flexible if we wanted to replace Bugsnag or change logging # behaviour. diff --git a/lib/open_food_network/feature_toggle.rb b/lib/open_food_network/feature_toggle.rb index 2863ef4cee..4886c92f97 100644 --- a/lib/open_food_network/feature_toggle.rb +++ b/lib/open_food_network/feature_toggle.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork # This feature toggles implementation provides two mechanisms to conditionally enable features. # diff --git a/lib/open_food_network/group_buy_report.rb b/lib/open_food_network/group_buy_report.rb index 6e5286dfec..c6ab52a6df 100644 --- a/lib/open_food_network/group_buy_report.rb +++ b/lib/open_food_network/group_buy_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork GroupBuyVariantRow = Struct.new(:variant, :sum_quantities, :sum_max_quantities) do def to_row diff --git a/lib/open_food_network/i18n_config.rb b/lib/open_food_network/i18n_config.rb index 3807aeae5d..8830f93378 100644 --- a/lib/open_food_network/i18n_config.rb +++ b/lib/open_food_network/i18n_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork # Provides access to the language settings. # Currently, language settings are read from the environment. diff --git a/lib/open_food_network/lettuce_share_report.rb b/lib/open_food_network/lettuce_share_report.rb index 49fffbadac..25868c9006 100644 --- a/lib/open_food_network/lettuce_share_report.rb +++ b/lib/open_food_network/lettuce_share_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/products_and_inventory_report_base' require 'variant_units/option_value_namer' diff --git a/lib/open_food_network/order_and_distributor_report.rb b/lib/open_food_network/order_and_distributor_report.rb index a82f300873..310e8c537d 100644 --- a/lib/open_food_network/order_and_distributor_report.rb +++ b/lib/open_food_network/order_and_distributor_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class OrderAndDistributorReport def initialize(user, params = {}, render_table = false) diff --git a/lib/open_food_network/order_cycle_form_applicator.rb b/lib/open_food_network/order_cycle_form_applicator.rb index 9ea6d17c07..67952eb632 100644 --- a/lib/open_food_network/order_cycle_form_applicator.rb +++ b/lib/open_food_network/order_cycle_form_applicator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/order_cycle_permissions' module OpenFoodNetwork diff --git a/lib/open_food_network/order_grouper.rb b/lib/open_food_network/order_grouper.rb index 0a0056e6de..cc4720bab9 100644 --- a/lib/open_food_network/order_grouper.rb +++ b/lib/open_food_network/order_grouper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class OrderGrouper def initialize(rules, column_constructors, report = nil) diff --git a/lib/open_food_network/orders_and_fulfillments_report.rb b/lib/open_food_network/orders_and_fulfillments_report.rb index ed7850d644..d6bd7487d6 100644 --- a/lib/open_food_network/orders_and_fulfillments_report.rb +++ b/lib/open_food_network/orders_and_fulfillments_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open_food_network/reports/line_items" require "open_food_network/orders_and_fulfillments_report/supplier_totals_report" require "open_food_network/orders_and_fulfillments_report/supplier_totals_by_distributor_report" diff --git a/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report.rb b/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report.rb index 94bd22882c..ee5c4f4007 100644 --- a/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report.rb +++ b/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + # rubocop:disable Metrics/ClassLength module OpenFoodNetwork class OrdersAndFulfillmentsReport class CustomerTotalsReport - REPORT_TYPE = "order_cycle_customer_totals".freeze + REPORT_TYPE = "order_cycle_customer_totals" attr_reader :context diff --git a/lib/open_food_network/orders_and_fulfillments_report/default_report.rb b/lib/open_food_network/orders_and_fulfillments_report/default_report.rb index b739e4c238..9fd0efa6a0 100644 --- a/lib/open_food_network/orders_and_fulfillments_report/default_report.rb +++ b/lib/open_food_network/orders_and_fulfillments_report/default_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class OrdersAndFulfillmentsReport class DefaultReport diff --git a/lib/open_food_network/orders_and_fulfillments_report/distributor_totals_by_supplier_report.rb b/lib/open_food_network/orders_and_fulfillments_report/distributor_totals_by_supplier_report.rb index e5cfa48379..5ce88bdab6 100644 --- a/lib/open_food_network/orders_and_fulfillments_report/distributor_totals_by_supplier_report.rb +++ b/lib/open_food_network/orders_and_fulfillments_report/distributor_totals_by_supplier_report.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + module OpenFoodNetwork class OrdersAndFulfillmentsReport class DistributorTotalsBySupplierReport - REPORT_TYPE = "order_cycle_distributor_totals_by_supplier".freeze + REPORT_TYPE = "order_cycle_distributor_totals_by_supplier" attr_reader :context diff --git a/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_by_distributor_report.rb b/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_by_distributor_report.rb index 98aa381a79..d294a514c6 100644 --- a/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_by_distributor_report.rb +++ b/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_by_distributor_report.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + module OpenFoodNetwork class OrdersAndFulfillmentsReport class SupplierTotalsByDistributorReport - REPORT_TYPE = "order_cycle_supplier_totals_by_distributor".freeze + REPORT_TYPE = "order_cycle_supplier_totals_by_distributor" attr_reader :context diff --git a/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_report.rb b/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_report.rb index a7a341664c..60c11d93e0 100644 --- a/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_report.rb +++ b/lib/open_food_network/orders_and_fulfillments_report/supplier_totals_report.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + module OpenFoodNetwork class OrdersAndFulfillmentsReport class SupplierTotalsReport - REPORT_TYPE = "order_cycle_supplier_totals".freeze + REPORT_TYPE = "order_cycle_supplier_totals" attr_reader :context diff --git a/lib/open_food_network/packing_report.rb b/lib/open_food_network/packing_report.rb index 3f6eaa0b82..ab60c449a5 100644 --- a/lib/open_food_network/packing_report.rb +++ b/lib/open_food_network/packing_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "open_food_network/reports/line_items" module OpenFoodNetwork diff --git a/lib/open_food_network/paperclippable.rb b/lib/open_food_network/paperclippable.rb index 4bb6396695..e510c6af82 100644 --- a/lib/open_food_network/paperclippable.rb +++ b/lib/open_food_network/paperclippable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Allow use of Paperclip's has_attached_file on non-ActiveRecord classes # https://gist.github.com/basgys/5712426 diff --git a/lib/open_food_network/permissions.rb b/lib/open_food_network/permissions.rb index 8f55de56fe..a3ddb7f36e 100644 --- a/lib/open_food_network/permissions.rb +++ b/lib/open_food_network/permissions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class Permissions def initialize(user) diff --git a/lib/open_food_network/products_and_inventory_report.rb b/lib/open_food_network/products_and_inventory_report.rb index 0e89434abd..df40f3aa4c 100644 --- a/lib/open_food_network/products_and_inventory_report.rb +++ b/lib/open_food_network/products_and_inventory_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/products_and_inventory_report_base' module OpenFoodNetwork diff --git a/lib/open_food_network/products_and_inventory_report_base.rb b/lib/open_food_network/products_and_inventory_report_base.rb index c669dc4d6a..22cd561f36 100644 --- a/lib/open_food_network/products_and_inventory_report_base.rb +++ b/lib/open_food_network/products_and_inventory_report_base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/scope_variant_to_hub' module OpenFoodNetwork diff --git a/lib/open_food_network/property_merge.rb b/lib/open_food_network/property_merge.rb index 82bf92eaee..84a5ed066a 100644 --- a/lib/open_food_network/property_merge.rb +++ b/lib/open_food_network/property_merge.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class PropertyMerge def self.merge(primary, secondary) diff --git a/lib/open_food_network/referer_parser.rb b/lib/open_food_network/referer_parser.rb index 20be289f44..5fa3ea5670 100644 --- a/lib/open_food_network/referer_parser.rb +++ b/lib/open_food_network/referer_parser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class RefererParser def self.path(referer) diff --git a/lib/open_food_network/reports/line_items.rb b/lib/open_food_network/reports/line_items.rb index 3fcc904246..c8622860df 100644 --- a/lib/open_food_network/reports/line_items.rb +++ b/lib/open_food_network/reports/line_items.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork module Reports # shared code to search and list line items diff --git a/lib/open_food_network/reports/list.rb b/lib/open_food_network/reports/list.rb index e4425ba936..bfbc625488 100644 --- a/lib/open_food_network/reports/list.rb +++ b/lib/open_food_network/reports/list.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork module Reports class List diff --git a/lib/open_food_network/sales_tax_report.rb b/lib/open_food_network/sales_tax_report.rb index 5d1099e824..e117b0924c 100644 --- a/lib/open_food_network/sales_tax_report.rb +++ b/lib/open_food_network/sales_tax_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class SalesTaxReport include Spree::ReportsHelper diff --git a/lib/open_food_network/scope_product_to_hub.rb b/lib/open_food_network/scope_product_to_hub.rb index a8707b7032..e50790a8da 100644 --- a/lib/open_food_network/scope_product_to_hub.rb +++ b/lib/open_food_network/scope_product_to_hub.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/scope_variant_to_hub' module OpenFoodNetwork diff --git a/lib/open_food_network/scope_variant_to_hub.rb b/lib/open_food_network/scope_variant_to_hub.rb index 0e4f36e7e9..568121a342 100644 --- a/lib/open_food_network/scope_variant_to_hub.rb +++ b/lib/open_food_network/scope_variant_to_hub.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class ScopeVariantToHub def initialize(hub, variant_overrides = nil) diff --git a/lib/open_food_network/scope_variants_for_search.rb b/lib/open_food_network/scope_variants_for_search.rb index 5d16eafefe..1ceb52499d 100644 --- a/lib/open_food_network/scope_variants_for_search.rb +++ b/lib/open_food_network/scope_variants_for_search.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open_food_network/scope_variant_to_hub' # Used to return a set of variants which match the criteria provided diff --git a/lib/open_food_network/spree_api_key_loader.rb b/lib/open_food_network/spree_api_key_loader.rb index 5eb7236221..c3a532acbf 100644 --- a/lib/open_food_network/spree_api_key_loader.rb +++ b/lib/open_food_network/spree_api_key_loader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork module SpreeApiKeyLoader def load_spree_api_key diff --git a/lib/open_food_network/tag_rule_applicator.rb b/lib/open_food_network/tag_rule_applicator.rb index 0c01f5dd18..09060a8ecf 100644 --- a/lib/open_food_network/tag_rule_applicator.rb +++ b/lib/open_food_network/tag_rule_applicator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class TagRuleApplicator attr_reader :enterprise, :rule_class, :customer_tags diff --git a/lib/open_food_network/users_and_enterprises_report.rb b/lib/open_food_network/users_and_enterprises_report.rb index a6b6530b7e..fc13095534 100644 --- a/lib/open_food_network/users_and_enterprises_report.rb +++ b/lib/open_food_network/users_and_enterprises_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class UsersAndEnterprisesReport attr_reader :params diff --git a/lib/open_food_network/xero_invoices_report.rb b/lib/open_food_network/xero_invoices_report.rb index 9a21e315c7..b36cc95ca1 100644 --- a/lib/open_food_network/xero_invoices_report.rb +++ b/lib/open_food_network/xero_invoices_report.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module OpenFoodNetwork class XeroInvoicesReport def initialize(user, opts = {}, compile_table = false) diff --git a/lib/spree/authentication_helpers.rb b/lib/spree/authentication_helpers.rb index 64e015fb5c..f463ebbdb4 100644 --- a/lib/spree/authentication_helpers.rb +++ b/lib/spree/authentication_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Spree module AuthenticationHelpers def self.included(receiver) diff --git a/lib/stripe/account_connector.rb b/lib/stripe/account_connector.rb index cb96c0e1d8..f92d452aa0 100644 --- a/lib/stripe/account_connector.rb +++ b/lib/stripe/account_connector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Encapsulation of logic used to handle the response from Stripe following an # attempt to connect an account to the instance using the OAuth Connection Flow # https://stripe.com/docs/connect/standard-accounts#oauth-flow diff --git a/lib/stripe/profile_storer.rb b/lib/stripe/profile_storer.rb index f3176fcf9a..688bb4f9e8 100644 --- a/lib/stripe/profile_storer.rb +++ b/lib/stripe/profile_storer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Encapsulation of logic used to convert a token generated by Stripe Elements # into a Stripe Customer + Card which can then be charged at a later point in time # Stores the generated customer & card ids against the local instance of Spree::CreditCard diff --git a/lib/stripe/webhook_handler.rb b/lib/stripe/webhook_handler.rb index d7f49b186f..5fdf8da66b 100644 --- a/lib/stripe/webhook_handler.rb +++ b/lib/stripe/webhook_handler.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Stripe class WebhookHandler def initialize(event) diff --git a/lib/tasks/data.rake b/lib/tasks/data.rake index 838bed64ff..88ba3904cf 100644 --- a/lib/tasks/data.rake +++ b/lib/tasks/data.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :ofn do namespace :data do desc "Adding relationships based on recent order cycles" diff --git a/lib/tasks/data/anonymize_data.rake b/lib/tasks/data/anonymize_data.rake index bdc6e37c1f..21ecc090ce 100644 --- a/lib/tasks/data/anonymize_data.rake +++ b/lib/tasks/data/anonymize_data.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'highline' namespace :ofn do diff --git a/lib/tasks/enterprises.rake b/lib/tasks/enterprises.rake index 615a81ae8a..c062f0d46d 100644 --- a/lib/tasks/enterprises.rake +++ b/lib/tasks/enterprises.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'csv' namespace :ofn do diff --git a/lib/tasks/karma.rake b/lib/tasks/karma.rake index 2755a3f6a8..fe90a8d04f 100644 --- a/lib/tasks/karma.rake +++ b/lib/tasks/karma.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ENV["RAILS_ENV"] ||= 'test' namespace :karma do diff --git a/lib/tasks/missing_payments.rake b/lib/tasks/missing_payments.rake index da986d0f08..67a13e12cc 100644 --- a/lib/tasks/missing_payments.rake +++ b/lib/tasks/missing_payments.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Find gaps in the sequence of payment ids. # If there are gaps then see if there is a log entry with a payment result for # the now lost payment. If there are some then you probably want to follow up diff --git a/lib/tasks/sample_data.rake b/lib/tasks/sample_data.rake index 40cc210f6d..c349831211 100644 --- a/lib/tasks/sample_data.rake +++ b/lib/tasks/sample_data.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/customer_factory" require "tasks/sample_data/enterprise_factory" require "tasks/sample_data/fee_factory" diff --git a/lib/tasks/sample_data/addressing.rb b/lib/tasks/sample_data/addressing.rb index c7f651837f..96319f98a3 100644 --- a/lib/tasks/sample_data/addressing.rb +++ b/lib/tasks/sample_data/addressing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Addressing private diff --git a/lib/tasks/sample_data/customer_factory.rb b/lib/tasks/sample_data/customer_factory.rb index 866f98f487..169f4d9fc4 100644 --- a/lib/tasks/sample_data/customer_factory.rb +++ b/lib/tasks/sample_data/customer_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/logging" module SampleData diff --git a/lib/tasks/sample_data/enterprise_factory.rb b/lib/tasks/sample_data/enterprise_factory.rb index 5c884dfc9e..7a2055eed5 100644 --- a/lib/tasks/sample_data/enterprise_factory.rb +++ b/lib/tasks/sample_data/enterprise_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/addressing" require "tasks/sample_data/logging" diff --git a/lib/tasks/sample_data/fee_factory.rb b/lib/tasks/sample_data/fee_factory.rb index c972be971d..5142b84431 100644 --- a/lib/tasks/sample_data/fee_factory.rb +++ b/lib/tasks/sample_data/fee_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/logging" module SampleData diff --git a/lib/tasks/sample_data/group_factory.rb b/lib/tasks/sample_data/group_factory.rb index 8c51a362e9..d3e1047bcf 100644 --- a/lib/tasks/sample_data/group_factory.rb +++ b/lib/tasks/sample_data/group_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/addressing" require "tasks/sample_data/logging" diff --git a/lib/tasks/sample_data/inventory_factory.rb b/lib/tasks/sample_data/inventory_factory.rb index 22d836c1ed..bcd719779a 100644 --- a/lib/tasks/sample_data/inventory_factory.rb +++ b/lib/tasks/sample_data/inventory_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/logging" module SampleData diff --git a/lib/tasks/sample_data/logging.rb b/lib/tasks/sample_data/logging.rb index 4c8ca493b6..ad85624092 100644 --- a/lib/tasks/sample_data/logging.rb +++ b/lib/tasks/sample_data/logging.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Logging private diff --git a/lib/tasks/sample_data/order_cycle_factory.rb b/lib/tasks/sample_data/order_cycle_factory.rb index 8fe9e11def..0f9dc258e8 100644 --- a/lib/tasks/sample_data/order_cycle_factory.rb +++ b/lib/tasks/sample_data/order_cycle_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/logging" module SampleData diff --git a/lib/tasks/sample_data/payment_method_factory.rb b/lib/tasks/sample_data/payment_method_factory.rb index 71d6870720..4febf09fa4 100644 --- a/lib/tasks/sample_data/payment_method_factory.rb +++ b/lib/tasks/sample_data/payment_method_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/addressing" require "tasks/sample_data/logging" diff --git a/lib/tasks/sample_data/permission_factory.rb b/lib/tasks/sample_data/permission_factory.rb index c5129c89c1..c2e1c9fc6a 100644 --- a/lib/tasks/sample_data/permission_factory.rb +++ b/lib/tasks/sample_data/permission_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/logging" module SampleData diff --git a/lib/tasks/sample_data/product_factory.rb b/lib/tasks/sample_data/product_factory.rb index 56869186da..0591617f8b 100644 --- a/lib/tasks/sample_data/product_factory.rb +++ b/lib/tasks/sample_data/product_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/logging" module SampleData diff --git a/lib/tasks/sample_data/shipping_method_factory.rb b/lib/tasks/sample_data/shipping_method_factory.rb index e2688e744f..09bb0a7653 100644 --- a/lib/tasks/sample_data/shipping_method_factory.rb +++ b/lib/tasks/sample_data/shipping_method_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/addressing" require "tasks/sample_data/logging" diff --git a/lib/tasks/sample_data/taxon_factory.rb b/lib/tasks/sample_data/taxon_factory.rb index 5278003022..d9545c24d1 100644 --- a/lib/tasks/sample_data/taxon_factory.rb +++ b/lib/tasks/sample_data/taxon_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/logging" module SampleData diff --git a/lib/tasks/sample_data/user_factory.rb b/lib/tasks/sample_data/user_factory.rb index 4d7d132b48..d7b0648871 100644 --- a/lib/tasks/sample_data/user_factory.rb +++ b/lib/tasks/sample_data/user_factory.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "tasks/sample_data/logging" module SampleData diff --git a/lib/tasks/specs.rake b/lib/tasks/specs.rake index feaf06eb60..64ef61f0ed 100644 --- a/lib/tasks/specs.rake +++ b/lib/tasks/specs.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :ofn do namespace :specs do namespace :run do diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake index 30f76f9449..d1249cb9a0 100644 --- a/lib/tasks/users.rake +++ b/lib/tasks/users.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'csv' namespace :ofn do diff --git a/spec/components/distributor_title_component_spec.rb b/spec/components/distributor_title_component_spec.rb index f864a99181..b678027f49 100644 --- a/spec/components/distributor_title_component_spec.rb +++ b/spec/components/distributor_title_component_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe "DistributorTitle tests", type: :component do diff --git a/spec/components/example_component_spec.rb b/spec/components/example_component_spec.rb index d6f455c6be..f40eeb5ee8 100644 --- a/spec/components/example_component_spec.rb +++ b/spec/components/example_component_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "spec_helper" describe "ExampleComponent tests", type: :component do diff --git a/spec/components/stories/distributor_title_component_stories.rb b/spec/components/stories/distributor_title_component_stories.rb index 9a292449b5..410288cb56 100644 --- a/spec/components/stories/distributor_title_component_stories.rb +++ b/spec/components/stories/distributor_title_component_stories.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class DistributorTitleComponentStories < ViewComponent::Storybook::Stories story(:default) do controls do diff --git a/spec/components/stories/example_component_stories.rb b/spec/components/stories/example_component_stories.rb index 874b3cf576..46230c86d3 100644 --- a/spec/components/stories/example_component_stories.rb +++ b/spec/components/stories/example_component_stories.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ExampleComponentStories < ViewComponent::Storybook::Stories story(:with_short_text) do controls do diff --git a/spec/features/consumer/shopping/unit_price_spec.rb b/spec/features/consumer/shopping/unit_price_spec.rb index 78cfaa39a3..0bf9c18343 100644 --- a/spec/features/consumer/shopping/unit_price_spec.rb +++ b/spec/features/consumer/shopping/unit_price_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' feature "As a consumer, I want to check unit price information for a product", js: true do diff --git a/spec/helpers/terms_and_conditions_helper_spec.rb b/spec/helpers/terms_and_conditions_helper_spec.rb index 3878891b28..4121725d2a 100644 --- a/spec/helpers/terms_and_conditions_helper_spec.rb +++ b/spec/helpers/terms_and_conditions_helper_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe TermsAndConditionsHelper, type: :helper do diff --git a/spec/lib/open_food_network/reports/line_items_spec.rb b/spec/lib/open_food_network/reports/line_items_spec.rb index 63d9696f4b..34f8f359bf 100644 --- a/spec/lib/open_food_network/reports/line_items_spec.rb +++ b/spec/lib/open_food_network/reports/line_items_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'open_food_network/reports/line_items' diff --git a/spec/models/concerns/balance_spec.rb b/spec/models/concerns/balance_spec.rb index b723284456..9531f04816 100644 --- a/spec/models/concerns/balance_spec.rb +++ b/spec/models/concerns/balance_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Balance do diff --git a/spec/services/order_data_masker_spec.rb b/spec/services/order_data_masker_spec.rb index 70aeab7bd9..9c98f967e2 100644 --- a/spec/services/order_data_masker_spec.rb +++ b/spec/services/order_data_masker_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe OrderDataMasker do