mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
Merge latest :master into :drop-blockenspiel branch and resolve conflicts related to Rubocop fixes.
This commit is contained in:
@@ -21,12 +21,10 @@
|
||||
Layout/LineLength:
|
||||
Max: 100
|
||||
Exclude:
|
||||
- Gemfile
|
||||
- app/controllers/admin/bulk_line_items_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
|
||||
@@ -38,9 +36,6 @@ Layout/LineLength:
|
||||
- app/controllers/admin/variant_overrides_controller.rb
|
||||
- app/controllers/api/enterprise_attachment_controller.rb
|
||||
- app/controllers/api/product_images_controller.rb
|
||||
- app/controllers/spree/admin/adjustments_controller_decorator.rb
|
||||
- app/controllers/spree/admin/orders_controller_decorator.rb
|
||||
- app/controllers/spree/credit_cards_controller.rb
|
||||
- app/controllers/spree/paypal_controller_decorator.rb
|
||||
- app/controllers/stripe/callbacks_controller.rb
|
||||
- app/helpers/angular_form_builder.rb
|
||||
@@ -50,8 +45,6 @@ Layout/LineLength:
|
||||
- app/helpers/injection_helper.rb
|
||||
- app/helpers/markdown_helper.rb
|
||||
- app/helpers/order_cycles_helper.rb
|
||||
- app/helpers/shop_helper.rb
|
||||
- app/helpers/spree/admin/base_helper_decorator.rb
|
||||
- app/helpers/spree/orders_helper.rb
|
||||
- app/jobs/subscription_confirm_job.rb
|
||||
- app/mailers/subscription_mailer.rb
|
||||
@@ -66,9 +59,6 @@ Layout/LineLength:
|
||||
- app/models/enterprise_role.rb
|
||||
- app/models/inventory_item.rb
|
||||
- app/models/product_import/entry_processor.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/product_import/product_importer.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
|
||||
@@ -85,19 +75,23 @@ Layout/LineLength:
|
||||
- app/models/spree/payment_method_decorator.rb
|
||||
- app/models/spree/product_decorator.rb
|
||||
- app/models/spree/shipping_method_decorator.rb
|
||||
- app/models/spree/tax_rate_decorator.rb
|
||||
- app/models/spree/taxon_decorator.rb
|
||||
- app/models/spree/tax_rate_decorator.rb
|
||||
- app/models/spree/user.rb
|
||||
- app/models/subscription.rb
|
||||
- app/models/variant_override.rb
|
||||
- app/models/variant_override_set.rb
|
||||
- app/serializers/api/admin/subscription_line_item_serializer.rb
|
||||
- app/services/cart_service.rb
|
||||
- app/services/default_stock_location.rb
|
||||
- app/services/embedded_page_service.rb
|
||||
- app/services/order_cycle_form.rb
|
||||
- app/services/order_factory.rb
|
||||
- app/services/variants_stock_levels.rb
|
||||
- engines/order_management/app/services/order_management/subscriptions/validator.rb
|
||||
- engines/web/app/helpers/web/cookies_policy_helper.rb
|
||||
- engines/web/config/routes.rb
|
||||
- engines/web/spec/features/consumer/cookies_spec.rb
|
||||
- Gemfile
|
||||
- lib/discourse/single_sign_on.rb
|
||||
- lib/open_food_network/available_payment_method_filter.rb
|
||||
- lib/open_food_network/bulk_coop_report.rb
|
||||
@@ -112,12 +106,12 @@ Layout/LineLength:
|
||||
- lib/open_food_network/payments_report.rb
|
||||
- lib/open_food_network/reports/bulk_coop_allocation_report.rb
|
||||
- lib/open_food_network/sales_tax_report.rb
|
||||
- lib/open_food_network/scope_variants_for_search.rb
|
||||
- lib/open_food_network/variant_and_line_item_naming.rb
|
||||
- lib/open_food_network/xero_invoices_report.rb
|
||||
- lib/spree/core/controller_helpers/respond_with_decorator.rb
|
||||
- lib/spree/localized_number.rb
|
||||
- lib/spree/product_filters.rb
|
||||
- lib/stripe/profile_storer.rb
|
||||
- lib/tasks/data.rake
|
||||
- lib/tasks/enterprises.rake
|
||||
- spec/controllers/admin/bulk_line_items_controller_spec.rb
|
||||
@@ -151,19 +145,21 @@ Layout/LineLength:
|
||||
- spec/controllers/shops_controller_spec.rb
|
||||
- spec/controllers/spree/admin/adjustments_controller_spec.rb
|
||||
- spec/controllers/spree/admin/base_controller_spec.rb
|
||||
- spec/controllers/spree/admin/orders/customer_details_controller_spec.rb
|
||||
- spec/controllers/spree/admin/orders_controller_spec.rb
|
||||
- spec/controllers/spree/admin/orders/customer_details_controller_spec.rb
|
||||
- spec/controllers/spree/admin/payment_methods_controller_spec.rb
|
||||
- spec/controllers/spree/admin/products_controller_spec.rb
|
||||
- spec/controllers/spree/admin/reports_controller_spec.rb
|
||||
- spec/controllers/spree/admin/variants_controller_spec.rb
|
||||
- spec/controllers/spree/credit_cards_controller_spec.rb
|
||||
- spec/controllers/spree/orders_controller_spec.rb
|
||||
- spec/controllers/spree/user_sessions_controller_spec.rb
|
||||
- spec/controllers/spree/users_controller_spec.rb
|
||||
- spec/controllers/spree/user_sessions_controller_spec.rb
|
||||
- spec/controllers/stripe/callbacks_controller_spec.rb
|
||||
- spec/controllers/stripe/webhooks_controller_spec.rb
|
||||
- spec/controllers/user_confirmations_controller_spec.rb
|
||||
- spec/factories/order_factory.rb
|
||||
- spec/factories.rb
|
||||
- spec/features/admin/adjustments_spec.rb
|
||||
- spec/features/admin/bulk_order_management_spec.rb
|
||||
- spec/features/admin/bulk_product_update_spec.rb
|
||||
@@ -171,13 +167,19 @@ Layout/LineLength:
|
||||
- spec/features/admin/enterprise_fees_spec.rb
|
||||
- spec/features/admin/enterprise_relationships_spec.rb
|
||||
- spec/features/admin/enterprise_roles_spec.rb
|
||||
- spec/features/admin/enterprise_user_spec.rb
|
||||
- spec/features/admin/enterprises/images_spec.rb
|
||||
- spec/features/admin/enterprises/index_spec.rb
|
||||
- spec/features/admin/enterprises_spec.rb
|
||||
- spec/features/admin/enterprise_user_spec.rb
|
||||
- spec/features/admin/image_settings_spec.rb
|
||||
- spec/features/admin/multilingual_spec.rb
|
||||
- spec/features/admin/order_cycles_spec.rb
|
||||
- spec/features/admin/order_cycles/complex_creating_specific_time_spec.rb
|
||||
- spec/features/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb
|
||||
- spec/features/admin/order_cycles/complex_editing_spec.rb
|
||||
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
|
||||
- spec/features/admin/order_cycles/list_spec.rb
|
||||
- spec/features/admin/order_cycles/simple_spec.rb
|
||||
- spec/features/admin/order_spec.rb
|
||||
- spec/features/admin/overview_spec.rb
|
||||
- spec/features/admin/payment_method_spec.rb
|
||||
- spec/features/admin/product_import_spec.rb
|
||||
@@ -193,9 +195,11 @@ Layout/LineLength:
|
||||
- spec/features/consumer/account/settings_spec.rb
|
||||
- spec/features/consumer/account_spec.rb
|
||||
- spec/features/consumer/authentication_spec.rb
|
||||
- spec/features/consumer/cookies_spec.rb
|
||||
- spec/features/consumer/caching/darkwarm_caching_spec.rb
|
||||
- spec/features/consumer/caching/shops_caching_spec.rb
|
||||
- spec/features/consumer/groups_spec.rb
|
||||
- spec/features/consumer/multilingual_spec.rb
|
||||
- spec/features/consumer/producers_spec.rb
|
||||
- spec/features/consumer/registration_spec.rb
|
||||
- spec/features/consumer/shopping/cart_spec.rb
|
||||
- spec/features/consumer/shopping/checkout_auth_spec.rb
|
||||
@@ -234,6 +238,7 @@ Layout/LineLength:
|
||||
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
|
||||
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
|
||||
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
|
||||
- spec/lib/open_food_network/user_balance_calculator_spec.rb
|
||||
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
|
||||
- spec/lib/open_food_network/xero_invoices_report_spec.rb
|
||||
- spec/lib/stripe/account_connector_spec.rb
|
||||
@@ -254,8 +259,8 @@ Layout/LineLength:
|
||||
- spec/models/exchange_spec.rb
|
||||
- spec/models/model_set_spec.rb
|
||||
- spec/models/order_cycle_spec.rb
|
||||
- spec/models/producer_property_spec.rb
|
||||
- spec/models/product_importer_spec.rb
|
||||
- spec/models/product_import/reset_absent_spec.rb
|
||||
- spec/models/proxy_order_spec.rb
|
||||
- spec/models/spree/ability_spec.rb
|
||||
- spec/models/spree/adjustment_spec.rb
|
||||
@@ -269,10 +274,9 @@ Layout/LineLength:
|
||||
- spec/models/spree/payment_spec.rb
|
||||
- spec/models/spree/product_set_spec.rb
|
||||
- spec/models/spree/product_spec.rb
|
||||
- spec/models/spree/property_spec.rb
|
||||
- spec/models/spree/shipping_method_spec.rb
|
||||
- spec/models/spree/tax_rate_spec.rb
|
||||
- spec/models/spree/taxon_spec.rb
|
||||
- spec/models/spree/tax_rate_spec.rb
|
||||
- spec/models/spree/user_spec.rb
|
||||
- spec/models/spree/variant_spec.rb
|
||||
- spec/models/stripe_account_spec.rb
|
||||
@@ -285,10 +289,10 @@ Layout/LineLength:
|
||||
- spec/performance/orders_controller_spec.rb
|
||||
- spec/performance/shop_controller_spec.rb
|
||||
- spec/requests/checkout/failed_checkout_spec.rb
|
||||
- spec/requests/checkout/stripe_sca_spec.rb
|
||||
- spec/requests/embedded_shopfronts_headers_spec.rb
|
||||
- spec/serializers/api/admin/customer_serializer_spec.rb
|
||||
- spec/serializers/api/admin/exchange_serializer_spec.rb
|
||||
- spec/serializers/api/admin/for_order_cycle/enterprise_serializer_spec.rb
|
||||
- spec/serializers/api/admin/for_order_cycle/supplied_product_serializer_spec.rb
|
||||
- spec/serializers/api/admin/order_cycle_serializer_spec.rb
|
||||
- spec/serializers/api/admin/subscription_customer_serializer_spec.rb
|
||||
@@ -297,6 +301,7 @@ Layout/LineLength:
|
||||
- spec/serializers/api/enterprise_shopfront_serializer_spec.rb
|
||||
- spec/serializers/api/order_serializer_spec.rb
|
||||
- spec/services/cart_service_spec.rb
|
||||
- spec/services/checkout/form_data_adapter_spec.rb
|
||||
- spec/services/embedded_page_service_spec.rb
|
||||
- spec/services/exchange_products_renderer_spec.rb
|
||||
- spec/services/order_cycle_distributed_products_spec.rb
|
||||
@@ -304,16 +309,17 @@ Layout/LineLength:
|
||||
- spec/services/order_cycle_form_spec.rb
|
||||
- spec/services/order_factory_spec.rb
|
||||
- spec/services/order_syncer_spec.rb
|
||||
- spec/services/order_tax_adjustments_fetcher_spec.rb
|
||||
- spec/services/permissions/order_spec.rb
|
||||
- spec/services/product_tag_rules_filterer_spec.rb
|
||||
- spec/services/permitted_attributes/order_cycle_spec.rb
|
||||
- spec/services/products_renderer_spec.rb
|
||||
- spec/services/product_tag_rules_filterer_spec.rb
|
||||
- spec/spec_helper.rb
|
||||
- spec/support/cancan_helper.rb
|
||||
- spec/support/delayed_job_helper.rb
|
||||
- spec/support/matchers/delegate_matchers.rb
|
||||
- spec/support/matchers/select2_matchers.rb
|
||||
- spec/support/matchers/table_matchers.rb
|
||||
- spec/support/request/authentication_workflow.rb
|
||||
- spec/support/request/shop_workflow.rb
|
||||
- spec/support/request/web_helper.rb
|
||||
- spec/support/seeds.rb
|
||||
@@ -327,7 +333,6 @@ Metrics/AbcSize:
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/admin/order_cycles_controller.rb
|
||||
- app/controllers/admin/product_import_controller.rb
|
||||
- app/controllers/admin/schedules_controller.rb
|
||||
- app/controllers/admin/stripe_accounts_controller.rb
|
||||
- app/controllers/admin/subscription_line_items_controller.rb
|
||||
- app/controllers/admin/subscriptions_controller.rb
|
||||
@@ -337,14 +342,12 @@ Metrics/AbcSize:
|
||||
- app/controllers/api/shipments_controller.rb
|
||||
- app/controllers/api/taxons_controller.rb
|
||||
- app/controllers/api/variants_controller.rb
|
||||
- app/controllers/base_controller.rb
|
||||
- app/controllers/cart_controller.rb
|
||||
- app/controllers/discourse_sso_controller.rb
|
||||
- app/controllers/enterprises_controller.rb
|
||||
- app/controllers/spree/admin/adjustments_controller_decorator.rb
|
||||
- app/controllers/spree/admin/image_settings_controller.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller.rb
|
||||
- app/controllers/spree/admin/overview_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
@@ -354,13 +357,12 @@ Metrics/AbcSize:
|
||||
- app/controllers/spree/admin/search_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/credit_cards_controller.rb
|
||||
- app/controllers/spree/orders_controller.rb
|
||||
- app/controllers/spree/user_passwords_controller.rb
|
||||
- app/controllers/spree/user_registrations_controller.rb
|
||||
- app/controllers/spree/user_sessions_controller.rb
|
||||
- app/controllers/spree/users_controller.rb
|
||||
- app/controllers/spree/user_sessions_controller.rb
|
||||
- app/controllers/stripe/callbacks_controller.rb
|
||||
- app/controllers/user_confirmations_controller.rb
|
||||
- app/controllers/user_passwords_controller.rb
|
||||
@@ -368,18 +370,19 @@ Metrics/AbcSize:
|
||||
- app/helpers/checkout_helper.rb
|
||||
- app/helpers/i18n_helper.rb
|
||||
- app/helpers/order_cycles_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/helpers/spree/admin/base_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/helpers/spree/admin/zones_helper.rb
|
||||
- app/helpers/spree/orders_helper.rb
|
||||
- app/models/calculator/flat_percent_per_item.rb
|
||||
- app/models/column_preference.rb
|
||||
- app/models/enterprise.rb
|
||||
- app/models/enterprise_group.rb
|
||||
- app/models/enterprise.rb
|
||||
- app/models/enterprise_relationship.rb
|
||||
- app/models/model_set.rb
|
||||
- app/models/product_import/entry_processor.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/product_import/product_importer.rb
|
||||
- app/models/proxy_order.rb
|
||||
- app/models/spree/ability_decorator.rb
|
||||
- app/models/spree/calculator/default_tax_decorator.rb
|
||||
@@ -389,12 +392,13 @@ Metrics/AbcSize:
|
||||
- app/models/spree/payment_decorator.rb
|
||||
- app/models/spree/product_decorator.rb
|
||||
- app/models/spree/taxon_decorator.rb
|
||||
- app/models/spree/tax_rate_decorator.rb
|
||||
- app/serializers/api/admin/enterprise_serializer.rb
|
||||
- app/serializers/api/admin/order_cycle_serializer.rb
|
||||
- app/serializers/api/product_serializer.rb
|
||||
- app/serializers/api/variant_serializer.rb
|
||||
- app/services/cart_service.rb
|
||||
- app/services/create_order_cycle.rb
|
||||
- app/services/order_cycle_form.rb
|
||||
- app/services/order_syncer.rb
|
||||
- engines/order_management/app/services/order_management/subscriptions/validator.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_decorator.rb
|
||||
@@ -414,7 +418,6 @@ Metrics/AbcSize:
|
||||
- lib/open_food_network/payments_report.rb
|
||||
- lib/open_food_network/permissions.rb
|
||||
- lib/open_food_network/products_and_inventory_report.rb
|
||||
- lib/open_food_network/rack_request_blocker.rb
|
||||
- lib/open_food_network/reports/line_items.rb
|
||||
- lib/open_food_network/sales_tax_report.rb
|
||||
- lib/open_food_network/users_and_enterprises_report.rb
|
||||
@@ -425,15 +428,17 @@ Metrics/AbcSize:
|
||||
- lib/spree/localized_number.rb
|
||||
- lib/stripe/account_connector.rb
|
||||
- lib/tasks/enterprises.rake
|
||||
- lib/tasks/sample_data/order_factory.rb
|
||||
- lib/tasks/sample_data/product_factory.rb
|
||||
- spec/features/admin/product_import_spec.rb
|
||||
- spec/features/admin/reports_spec.rb
|
||||
- spec/features/admin/subscriptions_spec.rb
|
||||
- spec/features/consumer/shopping/checkout_paypal_spec.rb
|
||||
- spec/features/consumer/shopping/shopping_spec.rb
|
||||
- spec/features/consumer/shopping/variant_overrides_spec.rb
|
||||
- spec/models/enterprise_spec.rb
|
||||
- spec/models/product_importer_spec.rb
|
||||
- spec/services/restart_checkout_spec.rb
|
||||
- spec/services/order_checkout_restart_spec.rb
|
||||
- spec/support/performance_helper.rb
|
||||
|
||||
Metrics/BlockLength:
|
||||
@@ -454,13 +459,14 @@ Metrics/BlockLength:
|
||||
Exclude:
|
||||
- lib/tasks/data.rake
|
||||
- spec/controllers/spree/admin/invoices_controller_spec.rb
|
||||
- spec/factories.rb
|
||||
- spec/factories/enterprise_factory.rb
|
||||
- spec/factories/order_cycle_factory.rb
|
||||
- spec/factories/order_factory.rb
|
||||
- spec/factories/product_factory.rb
|
||||
- spec/factories.rb
|
||||
- spec/factories/shipping_method_factory.rb
|
||||
- spec/factories/subscription_factory.rb
|
||||
- spec/factories/user_factory.rb
|
||||
- spec/factories/variant_factory.rb
|
||||
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
|
||||
- spec/lib/open_food_network/group_buy_report_spec.rb
|
||||
@@ -480,14 +486,13 @@ Metrics/CyclomaticComplexity:
|
||||
- app/helpers/checkout_helper.rb
|
||||
- app/helpers/i18n_helper.rb
|
||||
- app/helpers/order_cycles_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/helpers/spree/admin/base_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/models/enterprise.rb
|
||||
- app/models/enterprise_relationship.rb
|
||||
- app/models/product_import/entry_processor.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/spree/ability_decorator.rb
|
||||
- app/models/spree/payment_decorator.rb
|
||||
- app/models/spree/payment_method_decorator.rb
|
||||
- app/models/spree/product_decorator.rb
|
||||
- app/models/variant_override_set.rb
|
||||
- app/services/cart_service.rb
|
||||
@@ -512,8 +517,6 @@ Metrics/PerceivedComplexity:
|
||||
- app/helpers/order_cycles_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/models/enterprise_relationship.rb
|
||||
- app/models/product_import/entry_processor.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/spree/ability_decorator.rb
|
||||
- app/models/spree/order_decorator.rb
|
||||
- app/models/spree/product_decorator.rb
|
||||
@@ -529,6 +532,7 @@ Metrics/PerceivedComplexity:
|
||||
Metrics/MethodLength:
|
||||
Max: 10
|
||||
Exclude:
|
||||
- app/controllers/admin/contents_controller.rb
|
||||
- app/controllers/admin/customers_controller.rb
|
||||
- app/controllers/admin/enterprise_fees_controller.rb
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
@@ -540,12 +544,11 @@ Metrics/MethodLength:
|
||||
- app/controllers/api/shipments_controller.rb
|
||||
- app/controllers/api/taxons_controller.rb
|
||||
- app/controllers/api/variants_controller.rb
|
||||
- app/controllers/base_controller.rb
|
||||
- app/controllers/cart_controller.rb
|
||||
- app/controllers/shop_controller.rb
|
||||
- app/controllers/spree/admin/image_settings_controller.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/admin/products_controller.rb
|
||||
@@ -564,9 +567,9 @@ Metrics/MethodLength:
|
||||
- app/controllers/user_registrations_controller.rb
|
||||
- app/helpers/checkout_helper.rb
|
||||
- app/helpers/order_cycles_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/helpers/spree/admin/base_helper.rb
|
||||
- app/jobs/subscription_placement_job.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/mailers/producer_mailer.rb
|
||||
- app/models/column_preference.rb
|
||||
- app/models/enterprise.rb
|
||||
- app/models/enterprise_relationship.rb
|
||||
@@ -585,6 +588,7 @@ Metrics/MethodLength:
|
||||
- app/serializers/api/admin/order_cycle_serializer.rb
|
||||
- app/serializers/api/cached_enterprise_serializer.rb
|
||||
- app/services/order_cycle_form.rb
|
||||
- app/services/permitted_attributes/checkout.rb
|
||||
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
|
||||
- lib/discourse/single_sign_on.rb
|
||||
@@ -616,6 +620,9 @@ Metrics/MethodLength:
|
||||
- lib/spree/core/controller_helpers/respond_with_decorator.rb
|
||||
- lib/spree/localized_number.rb
|
||||
- lib/stripe/profile_storer.rb
|
||||
- lib/tasks/data/truncate_data.rb
|
||||
- lib/tasks/sample_data/group_factory.rb
|
||||
- lib/tasks/sample_data/order_factory.rb
|
||||
- lib/tasks/sample_data/product_factory.rb
|
||||
- spec/features/consumer/shopping/checkout_paypal_spec.rb
|
||||
- spec/features/consumer/shopping/variant_overrides_spec.rb
|
||||
@@ -627,16 +634,16 @@ Metrics/ClassLength:
|
||||
Exclude:
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/admin/order_cycles_controller.rb
|
||||
- app/controllers/admin/schedules_controller.rb
|
||||
- app/controllers/admin/subscriptions_controller.rb
|
||||
- app/controllers/api/products_controller.rb
|
||||
- app/controllers/application_controller.rb
|
||||
- app/controllers/checkout_controller.rb
|
||||
- app/controllers/spree/admin/base_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/products_controller.rb
|
||||
- app/controllers/spree/admin/reports_controller.rb
|
||||
- app/controllers/spree/admin/resource_controller.rb
|
||||
- app/controllers/spree/admin/products_controller.rb
|
||||
- app/controllers/spree/admin/users_controller.rb
|
||||
- app/controllers/spree/orders_controller.rb
|
||||
- app/models/enterprise.rb
|
||||
@@ -667,8 +674,8 @@ Metrics/ModuleLength:
|
||||
Exclude:
|
||||
- app/helpers/admin/injection_helper.rb
|
||||
- app/helpers/injection_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/helpers/spree/admin/base_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/estimator_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/form_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb
|
||||
@@ -692,6 +699,7 @@ Metrics/ModuleLength:
|
||||
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
|
||||
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
|
||||
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
|
||||
- spec/lib/open_food_network/user_balance_calculator_spec.rb
|
||||
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
|
||||
- spec/models/spree/ability_spec.rb
|
||||
- spec/models/spree/adjustment_spec.rb
|
||||
|
||||
@@ -40,6 +40,12 @@ Layout/MultilineMethodCallIndentation:
|
||||
Layout/LineLength:
|
||||
Max: 100
|
||||
|
||||
Lint/RaiseException:
|
||||
Enabled: true
|
||||
|
||||
Lint/StructNewOverride:
|
||||
Enabled: true
|
||||
|
||||
## TEMPORARY/CONTESTED SETTINGS
|
||||
#
|
||||
# These are still to be decided upon, but recommended for inclusion by
|
||||
|
||||
@@ -1,114 +1,24 @@
|
||||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config --exclude-limit 1400`
|
||||
# on 2020-02-22 11:23:29 +0000 using RuboCop version 0.80.0.
|
||||
# on 2020-06-22 13:28:10 +0100 using RuboCop version 0.81.0.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
# versions of RuboCop, may require this file to be generated again.
|
||||
|
||||
# Offense count: 6
|
||||
# Cop supports --auto-correct.
|
||||
Layout/EmptyLineAfterGuardClause:
|
||||
Exclude:
|
||||
- 'lib/open_food_network/bulk_coop_report.rb'
|
||||
- 'lib/open_food_network/orders_and_fulfillments_report.rb'
|
||||
- 'lib/open_food_network/packing_report.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
Layout/EmptyLines:
|
||||
Exclude:
|
||||
- 'app/models/spree/adjustment_decorator.rb'
|
||||
- 'spec/features/admin/order_cycles_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: empty_lines, no_empty_lines
|
||||
Layout/EmptyLinesAroundBlockBody:
|
||||
Exclude:
|
||||
- 'spec/controllers/api/orders_controller_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
|
||||
# SupportedStylesAlignWith: keyword, variable, start_of_line
|
||||
Layout/EndAlignment:
|
||||
Exclude:
|
||||
- 'lib/open_food_network/permalink_generator.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
||||
# SupportedHashRocketStyles: key, separator, table
|
||||
# SupportedColonStyles: key, separator, table
|
||||
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
||||
Layout/HashAlignment:
|
||||
Exclude:
|
||||
- 'spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb'
|
||||
|
||||
# Offense count: 8
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
|
||||
Layout/LeadingCommentSpace:
|
||||
Exclude:
|
||||
- 'Gemfile'
|
||||
- 'app/helpers/application_helper.rb'
|
||||
- 'app/models/enterprise.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Offense count: 139
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||
# URISchemes: http, https
|
||||
Layout/LineLength:
|
||||
Max: 115
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Layout/SpaceAfterColon:
|
||||
Exclude:
|
||||
- 'lib/open_food_network/order_cycle_form_applicator.rb'
|
||||
Max: 268
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
|
||||
# SupportedStylesForExponentOperator: space, no_space
|
||||
Layout/SpaceAroundOperators:
|
||||
Exclude:
|
||||
- 'app/services/cart_service.rb'
|
||||
- 'spec/support/cancan_helper.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
||||
# SupportedStyles: space, no_space, compact
|
||||
# SupportedStylesForEmptyBraces: space, no_space
|
||||
Layout/SpaceInsideHashLiteralBraces:
|
||||
Exclude:
|
||||
- 'spec/controllers/checkout_controller_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
Lint/AmbiguousOperator:
|
||||
Exclude:
|
||||
- 'spec/controllers/api/enterprise_fees_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/payments_controller_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
Lint/Debugger:
|
||||
Exclude:
|
||||
- 'app/services/order_factory.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Lint/DuplicateHashKey:
|
||||
Exclude:
|
||||
- 'spec/models/calculator/weight_spec.rb'
|
||||
|
||||
# Offense count: 4
|
||||
Lint/DuplicateMethods:
|
||||
Exclude:
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
|
||||
# Offense count: 10
|
||||
# Offense count: 9
|
||||
Lint/IneffectiveAccessModifier:
|
||||
Exclude:
|
||||
- 'app/models/column_preference.rb'
|
||||
@@ -117,31 +27,6 @@ Lint/IneffectiveAccessModifier:
|
||||
- 'lib/open_food_network/feature_toggle.rb'
|
||||
- 'spec/lib/open_food_network/reports/report_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Lint/InterpolationCheck:
|
||||
Exclude:
|
||||
- 'spec/features/consumer/shopping/embedded_groups_spec.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Cop supports --auto-correct.
|
||||
Lint/NonDeterministicRequireOrder:
|
||||
Exclude:
|
||||
- 'engines/order_management/spec/spec_helper.rb'
|
||||
- 'engines/web/spec/spec_helper.rb'
|
||||
- 'spec/spec_helper.rb'
|
||||
|
||||
# Offense count: 3
|
||||
Lint/ShadowingOuterLocalVariable:
|
||||
Exclude:
|
||||
- 'app/models/model_set.rb'
|
||||
- 'spec/models/model_set_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Configuration parameters: AllowKeywordBlockArguments.
|
||||
Lint/UnderscorePrefixedVariableName:
|
||||
Exclude:
|
||||
- 'spec/support/cancan_helper.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
|
||||
Lint/UselessAccessModifier:
|
||||
@@ -152,21 +37,10 @@ Lint/UselessAccessModifier:
|
||||
- 'lib/open_food_network/reports/bulk_coop_report.rb'
|
||||
- 'spec/lib/open_food_network/reports/report_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Lint/UselessAssignment:
|
||||
Exclude:
|
||||
- 'spec/**/*'
|
||||
- 'app/models/enterprise.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CheckForMethodsWithNoSideEffects.
|
||||
Lint/Void:
|
||||
Exclude:
|
||||
- 'app/serializers/api/enterprise_serializer.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Offense count: 6
|
||||
# Configuration parameters: IgnoredMethods.
|
||||
Metrics/AbcSize:
|
||||
Max: 16
|
||||
Max: 37
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CountComments, ExcludedMethods.
|
||||
@@ -174,6 +48,21 @@ Metrics/AbcSize:
|
||||
Metrics/BlockLength:
|
||||
Max: 27
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ClassLength:
|
||||
Max: 101
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: IgnoredMethods.
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 7
|
||||
|
||||
# Offense count: 6
|
||||
# Configuration parameters: CountComments, ExcludedMethods.
|
||||
Metrics/MethodLength:
|
||||
Max: 20
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ModuleLength:
|
||||
@@ -195,26 +84,15 @@ Naming/HeredocDelimiterNaming:
|
||||
Exclude:
|
||||
- 'app/models/content_configuration.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Offense count: 4
|
||||
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
|
||||
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
|
||||
Naming/MemoizedInstanceVariableName:
|
||||
Exclude:
|
||||
- 'app/mailers/producer_mailer.rb'
|
||||
- 'lib/open_food_network/address_finder.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
||||
# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
|
||||
Naming/MethodParameterName:
|
||||
Exclude:
|
||||
- 'app/helpers/spree/base_helper_decorator.rb'
|
||||
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
|
||||
- 'lib/open_food_network/reports/bulk_coop_report.rb'
|
||||
- 'lib/open_food_network/xero_invoices_report.rb'
|
||||
- 'spec/lib/open_food_network/reports/report_spec.rb'
|
||||
- 'spec/mailers/producer_mailer_spec.rb'
|
||||
|
||||
# Offense count: 22
|
||||
# Offense count: 19
|
||||
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
|
||||
# NamePrefix: is_, has_, have_
|
||||
# ForbiddenPrefixes: is_, has_, have_
|
||||
@@ -232,7 +110,6 @@ Naming/PredicateName:
|
||||
- 'app/models/spree/order_decorator.rb'
|
||||
- 'app/models/spree/payment_method_decorator.rb'
|
||||
- 'app/models/spree/preferences/file_configuration.rb'
|
||||
- 'app/models/spree/product_decorator.rb'
|
||||
- 'app/models/spree/shipping_method_decorator.rb'
|
||||
- 'lib/open_food_network/customers_report.rb'
|
||||
- 'lib/open_food_network/order_cycle_management_report.rb'
|
||||
@@ -240,143 +117,6 @@ Naming/PredicateName:
|
||||
- 'lib/open_food_network/packing_report.rb'
|
||||
- 'lib/tasks/data.rake'
|
||||
|
||||
# Offense count: 154
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, Include.
|
||||
# SupportedStyles: action, filter
|
||||
# Include: app/controllers/**/*.rb
|
||||
Rails/ActionFilter:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/column_preferences_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/enterprises_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/schedules_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/variant_overrides_controller.rb'
|
||||
- 'app/controllers/api/base_controller.rb'
|
||||
- 'app/controllers/api/enterprise_attachment_controller.rb'
|
||||
- 'app/controllers/api/enterprises_controller.rb'
|
||||
- 'app/controllers/api/shipments_controller.rb'
|
||||
- 'app/controllers/api/variants_controller.rb'
|
||||
- 'app/controllers/application_controller.rb'
|
||||
- 'app/controllers/base_controller.rb'
|
||||
- 'app/controllers/cart_controller.rb'
|
||||
- 'app/controllers/checkout_controller.rb'
|
||||
- 'app/controllers/discourse_sso_controller.rb'
|
||||
- 'app/controllers/enterprises_controller.rb'
|
||||
- 'app/controllers/home_controller.rb'
|
||||
- 'app/controllers/line_items_controller.rb'
|
||||
- 'app/controllers/producers_controller.rb'
|
||||
- 'app/controllers/registration_controller.rb'
|
||||
- 'app/controllers/shop_controller.rb'
|
||||
- 'app/controllers/shops_controller.rb'
|
||||
- 'app/controllers/spree/admin/adjustments_controller.rb'
|
||||
- 'app/controllers/spree/admin/base_controller.rb'
|
||||
- 'app/controllers/spree/admin/images_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/payment_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/payments_controller.rb'
|
||||
- 'app/controllers/spree/admin/product_properties_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller.rb'
|
||||
- 'app/controllers/spree/admin/reports/enterprise_fee_summaries_controller.rb'
|
||||
- 'app/controllers/spree/admin/reports_controller.rb'
|
||||
- 'app/controllers/spree/admin/resource_controller.rb'
|
||||
- 'app/controllers/spree/admin/search_controller.rb'
|
||||
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/states_controller.rb'
|
||||
- 'app/controllers/spree/admin/tax_rates_controller.rb'
|
||||
- 'app/controllers/spree/admin/users_controller.rb'
|
||||
- 'app/controllers/spree/admin/zones_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/controllers/spree/store_controller.rb'
|
||||
- 'app/controllers/spree/user_registrations_controller.rb'
|
||||
- 'app/controllers/spree/user_sessions_controller.rb'
|
||||
- 'app/controllers/spree/users_controller.rb'
|
||||
- 'app/controllers/stripe/webhooks_controller.rb'
|
||||
- 'app/controllers/user_passwords_controller.rb'
|
||||
- 'app/controllers/user_registrations_controller.rb'
|
||||
|
||||
# Offense count: 192
|
||||
# Cop supports --auto-correct.
|
||||
Rails/ActiveRecordAliases:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/bulk_line_items_controller.rb'
|
||||
- 'app/controllers/admin/enterprises_controller.rb'
|
||||
- 'app/controllers/admin/subscriptions_controller.rb'
|
||||
- 'app/controllers/api/customers_controller.rb'
|
||||
- 'app/controllers/api/enterprise_attachment_controller.rb'
|
||||
- 'app/controllers/api/enterprises_controller.rb'
|
||||
- 'app/controllers/api/product_images_controller.rb'
|
||||
- 'app/controllers/api/products_controller.rb'
|
||||
- 'app/controllers/api/shipments_controller.rb'
|
||||
- 'app/controllers/api/taxons_controller.rb'
|
||||
- 'app/controllers/api/variants_controller.rb'
|
||||
- 'app/controllers/checkout_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders/customer_details_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller.rb'
|
||||
- 'app/controllers/spree/admin/payment_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/resource_controller.rb'
|
||||
- 'app/controllers/spree/admin/taxons_controller.rb'
|
||||
- 'app/controllers/spree/admin/users_controller.rb'
|
||||
- 'app/controllers/spree/credit_cards_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/controllers/spree/users_controller.rb'
|
||||
- 'app/helpers/i18n_helper.rb'
|
||||
- 'app/jobs/subscription_placement_job.rb'
|
||||
- 'app/models/spree/adjustment_decorator.rb'
|
||||
- 'app/models/spree/line_item_decorator.rb'
|
||||
- 'app/models/spree/product_set.rb'
|
||||
- 'app/services/line_item_syncer.rb'
|
||||
- 'app/services/order_factory.rb'
|
||||
- 'app/services/order_syncer.rb'
|
||||
- 'app/services/user_default_address_setter.rb'
|
||||
- 'lib/open_food_network/order_cycle_form_applicator.rb'
|
||||
- 'lib/open_food_network/subscription_payment_updater.rb'
|
||||
- 'lib/stripe/profile_storer.rb'
|
||||
- 'spec/controllers/admin/proxy_orders_controller_spec.rb'
|
||||
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
|
||||
- 'spec/controllers/api/orders_controller_spec.rb'
|
||||
- 'spec/controllers/line_items_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
|
||||
- 'spec/controllers/spree/orders_controller_spec.rb'
|
||||
- 'spec/features/admin/order_cycles_spec.rb'
|
||||
- 'spec/features/admin/subscriptions_spec.rb'
|
||||
- 'spec/features/admin/variant_overrides_spec.rb'
|
||||
- 'spec/features/admin/variants_spec.rb'
|
||||
- 'spec/features/consumer/account_spec.rb'
|
||||
- 'spec/features/consumer/registration_spec.rb'
|
||||
- 'spec/features/consumer/shopping/cart_spec.rb'
|
||||
- 'spec/features/consumer/shopping/orders_spec.rb'
|
||||
- 'spec/features/consumer/shopping/shopping_spec.rb'
|
||||
- 'spec/jobs/subscription_confirm_job_spec.rb'
|
||||
- 'spec/jobs/subscription_placement_job_spec.rb'
|
||||
- 'spec/lib/open_food_network/proxy_order_syncer_spec.rb'
|
||||
- 'spec/models/customer_spec.rb'
|
||||
- 'spec/models/enterprise_caching_spec.rb'
|
||||
- 'spec/models/exchange_spec.rb'
|
||||
- 'spec/models/order_cycle_spec.rb'
|
||||
- 'spec/models/producer_property_spec.rb'
|
||||
- 'spec/models/proxy_order_spec.rb'
|
||||
- 'spec/models/spree/adjustment_spec.rb'
|
||||
- 'spec/models/spree/credit_card_spec.rb'
|
||||
- 'spec/models/spree/line_item_spec.rb'
|
||||
- 'spec/models/spree/order_spec.rb'
|
||||
- 'spec/models/spree/product_spec.rb'
|
||||
- 'spec/models/spree/user_spec.rb'
|
||||
- 'spec/models/spree/variant_spec.rb'
|
||||
- 'spec/requests/checkout/stripe_connect_spec.rb'
|
||||
- 'spec/services/order_syncer_spec.rb'
|
||||
- 'spec/services/subscription_estimator_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: strict, flexible
|
||||
@@ -384,17 +124,13 @@ Rails/Date:
|
||||
Exclude:
|
||||
- 'app/models/order_cycle.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: Whitelist.
|
||||
# Whitelist: find_by_sql
|
||||
Rails/DynamicFindBy:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/orders/customer_details_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller.rb'
|
||||
- 'app/controllers/spree/admin/payments_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller.rb'
|
||||
- 'spec/support/request/web_helper.rb'
|
||||
|
||||
# Offense count: 16
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
@@ -426,19 +162,25 @@ Rails/FindBy:
|
||||
- 'app/models/product_import/spreadsheet_data.rb'
|
||||
- 'app/models/spree/user.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
Rails/FindEach:
|
||||
Exclude:
|
||||
- 'app/models/spree/order_decorator.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
Rails/HasAndBelongsToMany:
|
||||
Exclude:
|
||||
- 'app/models/enterprise.rb'
|
||||
- 'app/models/enterprise_group.rb'
|
||||
- 'app/models/order_cycle.rb'
|
||||
- 'app/models/schedule.rb'
|
||||
- 'app/models/spree/concerns/payment_method_distributors.rb'
|
||||
- 'app/models/spree/line_item_decorator.rb'
|
||||
|
||||
# Offense count: 24
|
||||
# Offense count: 25
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
Rails/HasManyOrHasOneDependent:
|
||||
@@ -449,13 +191,13 @@ Rails/HasManyOrHasOneDependent:
|
||||
- 'app/models/spree/adjustment_decorator.rb'
|
||||
- 'app/models/spree/order_decorator.rb'
|
||||
- 'app/models/spree/payment_method_decorator.rb'
|
||||
- 'app/models/spree/property_decorator.rb'
|
||||
- 'app/models/spree/property.rb'
|
||||
- 'app/models/spree/shipping_method_decorator.rb'
|
||||
- 'app/models/spree/user.rb'
|
||||
- 'app/models/spree/variant_decorator.rb'
|
||||
- 'app/models/subscription.rb'
|
||||
|
||||
# Offense count: 83
|
||||
# Offense count: 84
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/helpers/**/*.rb
|
||||
Rails/HelperInstanceVariable:
|
||||
@@ -471,12 +213,30 @@ Rails/HelperInstanceVariable:
|
||||
- 'app/helpers/spree/admin/orders_helper.rb'
|
||||
- 'app/helpers/spree/orders_helper.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Offense count: 35
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
|
||||
Rails/Output:
|
||||
# Include: app/controllers/**/*.rb
|
||||
Rails/LexicallyScopedActionFilter:
|
||||
Exclude:
|
||||
- 'app/services/order_factory.rb'
|
||||
- 'app/controllers/admin/enterprise_groups_controller.rb'
|
||||
- 'app/controllers/admin/enterprises_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/schedules_controller.rb'
|
||||
- 'app/controllers/admin/subscriptions_controller.rb'
|
||||
- 'app/controllers/registration_controller.rb'
|
||||
- 'app/controllers/spree/admin/adjustments_controller.rb'
|
||||
- 'app/controllers/spree/admin/payment_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/payments_controller.rb'
|
||||
- 'app/controllers/spree/admin/product_properties_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller.rb'
|
||||
- 'app/controllers/spree/admin/search_controller.rb'
|
||||
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/users_controller.rb'
|
||||
- 'app/controllers/spree/admin/zones_controller.rb'
|
||||
- 'app/controllers/spree/users_controller.rb'
|
||||
- 'app/controllers/user_passwords_controller.rb'
|
||||
|
||||
# Offense count: 12
|
||||
Rails/OutputSafety:
|
||||
@@ -490,13 +250,14 @@ Rails/OutputSafety:
|
||||
- 'app/helpers/spree/reports_helper.rb'
|
||||
- 'app/serializers/api/product_serializer.rb'
|
||||
- 'lib/spree/money_decorator.rb'
|
||||
- 'spec/features/admin/orders_spec.rb'
|
||||
- 'spec/features/admin/order_print_ticket_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Configuration parameters: Include.
|
||||
# Include: **/Rakefile, **/*.rake
|
||||
Rails/RakeEnvironment:
|
||||
Exclude:
|
||||
- 'lib/capistrano/tasks/**/*.rake'
|
||||
- 'lib/tasks/specs.rake'
|
||||
|
||||
# Offense count: 9
|
||||
@@ -507,7 +268,7 @@ Rails/ReflectionClassName:
|
||||
- 'app/models/enterprise_role.rb'
|
||||
- 'app/models/subscription.rb'
|
||||
|
||||
# Offense count: 213
|
||||
# Offense count: 227
|
||||
# Configuration parameters: Blacklist, Whitelist.
|
||||
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
|
||||
Rails/SkipsModelValidations:
|
||||
@@ -527,10 +288,13 @@ Rails/SkipsModelValidations:
|
||||
- 'app/models/spree/credit_card_decorator.rb'
|
||||
- 'app/models/spree/order_decorator.rb'
|
||||
- 'app/models/spree/payment_decorator.rb'
|
||||
- 'app/models/spree/shipping_method_decorator.rb'
|
||||
- 'app/models/subscription.rb'
|
||||
- 'app/models/variant_override.rb'
|
||||
- 'app/services/order_factory.rb'
|
||||
- 'engines/order_management/spec/performance/order_management/subscriptions/proxy_order_syncer_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb'
|
||||
- 'lib/tasks/data/anonymize_data.rake'
|
||||
- 'lib/tasks/sample_data/product_factory.rb'
|
||||
- 'lib/tasks/users.rake'
|
||||
@@ -552,9 +316,12 @@ Rails/SkipsModelValidations:
|
||||
- 'spec/features/admin/bulk_order_management_spec.rb'
|
||||
- 'spec/features/admin/bulk_product_update_spec.rb'
|
||||
- 'spec/features/admin/configuration/tax_rates_spec.rb'
|
||||
- 'spec/features/admin/order_cycles_spec.rb'
|
||||
- 'spec/features/admin/orders_spec.rb'
|
||||
- 'spec/features/admin/order_cycles/complex_editing_spec.rb'
|
||||
- 'spec/features/admin/order_cycles/simple_spec.rb'
|
||||
- 'spec/features/admin/order_spec.rb'
|
||||
- 'spec/features/admin/payments_spec.rb'
|
||||
- 'spec/features/admin/reports_spec.rb'
|
||||
- 'spec/features/consumer/caching/shops_caching_spec.rb'
|
||||
- 'spec/features/consumer/shopping/checkout_spec.rb'
|
||||
- 'spec/features/consumer/shopping/products_spec.rb'
|
||||
- 'spec/features/consumer/shopping/shopping_spec.rb'
|
||||
@@ -566,7 +333,7 @@ Rails/SkipsModelValidations:
|
||||
- 'spec/lib/open_food_network/permissions_spec.rb'
|
||||
- 'spec/lib/open_food_network/products_and_inventory_report_spec.rb'
|
||||
- 'spec/lib/open_food_network/scope_variant_to_hub_spec.rb'
|
||||
- 'spec/lib/open_food_network/subscription_payment_updater_spec.rb'
|
||||
- 'spec/lib/stripe/credit_card_cloner_spec.rb'
|
||||
- 'spec/models/calculator/weight_spec.rb'
|
||||
- 'spec/models/concerns/variant_stock_spec.rb'
|
||||
- 'spec/models/enterprise_relationship_spec.rb'
|
||||
@@ -574,18 +341,27 @@ Rails/SkipsModelValidations:
|
||||
- 'spec/models/spree/adjustment_spec.rb'
|
||||
- 'spec/models/spree/line_item_spec.rb'
|
||||
- 'spec/models/spree/order_spec.rb'
|
||||
- 'spec/models/spree/product_spec.rb'
|
||||
- 'spec/models/spree/variant_spec.rb'
|
||||
- 'spec/models/tag_rule/discount_order_spec.rb'
|
||||
- 'spec/performance/proxy_order_syncer_spec.rb'
|
||||
- 'spec/serializers/api/admin/subscription_line_item_serializer_spec.rb'
|
||||
- 'spec/services/cache_service_spec.rb'
|
||||
- 'spec/services/order_cart_reset_spec.rb'
|
||||
- 'spec/services/order_checkout_restart_spec.rb'
|
||||
- 'spec/services/order_cycle_distributed_products_spec.rb'
|
||||
- 'spec/services/order_factory_spec.rb'
|
||||
- 'spec/services/order_syncer_spec.rb'
|
||||
- 'spec/services/product_tag_rules_filterer_spec.rb'
|
||||
- 'spec/services/products_renderer_spec.rb'
|
||||
- 'spec/services/restart_checkout_spec.rb'
|
||||
- 'spec/support/request/shop_workflow.rb'
|
||||
- 'spec/views/spree/shared/_order_details.html.haml_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
Rails/UniqueValidationWithoutIndex:
|
||||
Exclude:
|
||||
- 'app/models/customer.rb'
|
||||
- 'app/models/exchange.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: Environments.
|
||||
@@ -600,13 +376,12 @@ Style/CaseEquality:
|
||||
- 'app/helpers/angular_form_helper.rb'
|
||||
- 'spec/models/spree/payment_spec.rb'
|
||||
|
||||
# Offense count: 76
|
||||
# Offense count: 75
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AutoCorrect, EnforcedStyle.
|
||||
# SupportedStyles: nested, compact
|
||||
Style/ClassAndModuleChildren:
|
||||
Exclude:
|
||||
- 'app/helpers/angular_form_helper.rb'
|
||||
- 'app/models/calculator/flat_percent_per_item.rb'
|
||||
- 'app/models/spree/concerns/payment_method_distributors.rb'
|
||||
- 'app/models/spree/gateway/migs.rb'
|
||||
@@ -685,29 +460,15 @@ Style/ClassVars:
|
||||
Exclude:
|
||||
- 'lib/open_food_network/rack_request_blocker.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Style/CommentedKeyword:
|
||||
Exclude:
|
||||
- 'app/controllers/application_controller.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
|
||||
# SupportedStyles: assign_to_condition, assign_inside_condition
|
||||
Style/ConditionalAssignment:
|
||||
Exclude:
|
||||
- 'app/controllers/api/taxons_controller.rb'
|
||||
|
||||
# Offense count: 6
|
||||
# Offense count: 4
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: annotated, template, unannotated
|
||||
Style/FormatStringToken:
|
||||
Exclude:
|
||||
- 'app/helpers/order_cycles_helper.rb'
|
||||
- 'lib/open_food_network/sales_tax_report.rb'
|
||||
- 'spec/features/admin/bulk_order_management_spec.rb'
|
||||
|
||||
# Offense count: 920
|
||||
# Offense count: 874
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: always, always_true, never
|
||||
@@ -742,7 +503,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/controllers/admin/variant_overrides_controller.rb'
|
||||
- 'app/controllers/api/base_controller.rb'
|
||||
- 'app/controllers/api/customers_controller.rb'
|
||||
- 'app/controllers/api/enterprise_attachment_controller.rb'
|
||||
- 'app/controllers/api/enterprise_fees_controller.rb'
|
||||
- 'app/controllers/api/enterprises_controller.rb'
|
||||
- 'app/controllers/api/logos_controller.rb'
|
||||
@@ -786,7 +546,6 @@ Style/FrozenStringLiteralComment:
|
||||
- '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/enterprise_fee_summaries_controller.rb'
|
||||
- 'app/controllers/spree/admin/reports_controller.rb'
|
||||
- 'app/controllers/spree/admin/resource_controller.rb'
|
||||
- 'app/controllers/spree/admin/return_authorizations_controller.rb'
|
||||
@@ -847,7 +606,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/helpers/spree/api/api_helpers.rb'
|
||||
- 'app/helpers/spree/base_helper_decorator.rb'
|
||||
- 'app/helpers/spree/orders_helper.rb'
|
||||
- 'app/helpers/spree/products_helper_decorator.rb'
|
||||
- 'app/helpers/spree/reports_helper.rb'
|
||||
- 'app/helpers/spree_currency_helper.rb'
|
||||
- 'app/jobs/confirm_order_job.rb'
|
||||
@@ -935,7 +693,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/models/spree/gateway_decorator.rb'
|
||||
- 'app/models/spree/image_decorator.rb'
|
||||
- 'app/models/spree/line_item_decorator.rb'
|
||||
- 'app/models/spree/money_decorator.rb'
|
||||
- 'app/models/spree/option_type_decorator.rb'
|
||||
- 'app/models/spree/order_decorator.rb'
|
||||
- 'app/models/spree/payment_decorator.rb'
|
||||
@@ -947,9 +704,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/models/spree/product_property_decorator.rb'
|
||||
- 'app/models/spree/product_set.rb'
|
||||
- 'app/models/spree/property.rb'
|
||||
- 'app/models/spree/property_decorator.rb'
|
||||
- 'app/models/spree/shipment_decorator.rb'
|
||||
- 'app/models/spree/shipping_category_decorator.rb'
|
||||
- 'app/models/spree/shipping_method_decorator.rb'
|
||||
- 'app/models/spree/stock/availability_validator_decorator.rb'
|
||||
- 'app/models/spree/stock_location_decorator.rb'
|
||||
@@ -1072,8 +827,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/services/permissions/order.rb'
|
||||
- 'app/services/product_tag_rules_filterer.rb'
|
||||
- 'app/services/products_renderer.rb'
|
||||
- 'app/services/reset_order_service.rb'
|
||||
- 'app/services/restart_checkout.rb'
|
||||
- 'app/services/search_orders.rb'
|
||||
- 'app/services/tax_rate_finder.rb'
|
||||
- 'app/services/upload_sanitizer.rb'
|
||||
@@ -1112,7 +865,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'engines/order_management/lib/order_management/engine.rb'
|
||||
- 'engines/order_management/lib/order_management/version.rb'
|
||||
- 'engines/order_management/order_management.gemspec'
|
||||
- 'engines/order_management/spec/performance/order_management/subscriptions/proxy_order_syncer_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/authorizer_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/parameters_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/permissions_spec.rb'
|
||||
@@ -1120,7 +872,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/renderers/html_renderer_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb'
|
||||
- 'engines/order_management/spec/spec_helper.rb'
|
||||
- 'engines/web/app/controllers/web/angular_templates_controller.rb'
|
||||
- 'engines/web/app/controllers/web/api/cookies_consent_controller.rb'
|
||||
- 'engines/web/app/controllers/web/application_controller.rb'
|
||||
@@ -1131,7 +882,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'engines/web/lib/web/engine.rb'
|
||||
- 'engines/web/lib/web/version.rb'
|
||||
- 'engines/web/spec/helpers/cookies_policy_helper_spec.rb'
|
||||
- 'engines/web/spec/spec_helper.rb'
|
||||
- 'engines/web/web.gemspec'
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
- 'lib/open_food_network/address_finder.rb'
|
||||
@@ -1184,7 +934,6 @@ Style/FrozenStringLiteralComment:
|
||||
- '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/subscription_payment_updater.rb'
|
||||
- 'lib/open_food_network/tag_rule_applicator.rb'
|
||||
- 'lib/open_food_network/user_balance_calculator.rb'
|
||||
- 'lib/open_food_network/users_and_enterprises_report.rb'
|
||||
@@ -1204,7 +953,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'lib/stripe/webhook_handler.rb'
|
||||
- 'lib/tasks/data.rake'
|
||||
- 'lib/tasks/data/anonymize_data.rake'
|
||||
- 'lib/tasks/data/truncate_data.rake'
|
||||
- 'lib/tasks/enterprises.rake'
|
||||
- 'lib/tasks/karma.rake'
|
||||
- 'lib/tasks/missing_payments.rake'
|
||||
@@ -1245,7 +993,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/controllers/api/customers_controller_spec.rb'
|
||||
- 'spec/controllers/api/enterprise_fees_controller_spec.rb'
|
||||
- 'spec/controllers/api/enterprises_controller_spec.rb'
|
||||
- 'spec/controllers/api/exchange_products_controller_spec.rb'
|
||||
- 'spec/controllers/api/logos_controller_spec.rb'
|
||||
- 'spec/controllers/api/order_cycles_controller_spec.rb'
|
||||
- 'spec/controllers/api/orders_controller_spec.rb'
|
||||
@@ -1278,7 +1025,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/payments_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/products_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/reports/enterprise_fee_summaries_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/reports_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/search_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb'
|
||||
@@ -1333,14 +1079,11 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/features/admin/external_services_spec.rb'
|
||||
- 'spec/features/admin/image_settings_spec.rb'
|
||||
- 'spec/features/admin/multilingual_spec.rb'
|
||||
- 'spec/features/admin/order_cycles_spec.rb'
|
||||
- 'spec/features/admin/orders_spec.rb'
|
||||
- 'spec/features/admin/overview_spec.rb'
|
||||
- 'spec/features/admin/payment_method_spec.rb'
|
||||
- 'spec/features/admin/payments_spec.rb'
|
||||
- 'spec/features/admin/product_import_spec.rb'
|
||||
- 'spec/features/admin/products_spec.rb'
|
||||
- 'spec/features/admin/reports/enterprise_fee_summaries_spec.rb'
|
||||
- 'spec/features/admin/reports/packing_report_spec.rb'
|
||||
- 'spec/features/admin/reports_spec.rb'
|
||||
- 'spec/features/admin/schedules_spec.rb'
|
||||
@@ -1356,7 +1099,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/features/consumer/account_spec.rb'
|
||||
- 'spec/features/consumer/authentication_spec.rb'
|
||||
- 'spec/features/consumer/confirm_invitation_spec.rb'
|
||||
- 'spec/features/consumer/cookies_spec.rb'
|
||||
- 'spec/features/consumer/footer_links_spec.rb'
|
||||
- 'spec/features/consumer/groups_spec.rb'
|
||||
- 'spec/features/consumer/multilingual_spec.rb'
|
||||
@@ -1384,7 +1126,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/helpers/injection_helper_spec.rb'
|
||||
- 'spec/helpers/navigation_helper_spec.rb'
|
||||
- 'spec/helpers/order_cycles_helper_spec.rb'
|
||||
- 'spec/helpers/products_helper_spec.rb'
|
||||
- 'spec/helpers/serializer_helper_spec.rb'
|
||||
- 'spec/helpers/shared_helper_spec.rb'
|
||||
- 'spec/helpers/shop_helper_spec.rb'
|
||||
@@ -1431,7 +1172,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/lib/open_food_network/sales_tax_report_spec.rb'
|
||||
- 'spec/lib/open_food_network/scope_variant_to_hub_spec.rb'
|
||||
- 'spec/lib/open_food_network/scope_variants_to_search_spec.rb'
|
||||
- 'spec/lib/open_food_network/subscription_payment_updater_spec.rb'
|
||||
- 'spec/lib/open_food_network/tag_rule_applicator_spec.rb'
|
||||
- 'spec/lib/open_food_network/user_balance_calculator_spec.rb'
|
||||
- 'spec/lib/open_food_network/users_and_enterprises_report_spec.rb'
|
||||
@@ -1465,7 +1205,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/models/model_set_spec.rb'
|
||||
- 'spec/models/order_cycle_spec.rb'
|
||||
- 'spec/models/order_updater_spec.rb'
|
||||
- 'spec/models/producer_property_spec.rb'
|
||||
- 'spec/models/product_import/entry_processor_spec.rb'
|
||||
- 'spec/models/product_import/inventory_reset_strategy_spec.rb'
|
||||
- 'spec/models/product_import/reset_absent_spec.rb'
|
||||
@@ -1494,7 +1233,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/models/spree/price_spec.rb'
|
||||
- 'spec/models/spree/product_set_spec.rb'
|
||||
- 'spec/models/spree/product_spec.rb'
|
||||
- 'spec/models/spree/property_spec.rb'
|
||||
- 'spec/models/spree/shipment_spec.rb'
|
||||
- 'spec/models/spree/shipping_method_spec.rb'
|
||||
- 'spec/models/spree/stock/availability_validator_spec.rb'
|
||||
@@ -1563,8 +1301,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/services/permissions/order_spec.rb'
|
||||
- 'spec/services/product_tag_rules_filterer_spec.rb'
|
||||
- 'spec/services/products_renderer_spec.rb'
|
||||
- 'spec/services/reset_order_service_spec.rb'
|
||||
- 'spec/services/restart_checkout_spec.rb'
|
||||
- 'spec/services/search_orders_spec.rb'
|
||||
- 'spec/services/tax_rate_finder_spec.rb'
|
||||
- 'spec/services/upload_sanitizer_spec.rb'
|
||||
@@ -1573,7 +1309,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/support/ability_helper.rb'
|
||||
- 'spec/support/api_helper.rb'
|
||||
- 'spec/support/cancan_helper.rb'
|
||||
- 'spec/support/controller_hacks.rb'
|
||||
- 'spec/support/controller_helper.rb'
|
||||
- 'spec/support/delayed_job_helper.rb'
|
||||
- 'spec/support/downloads_helper.rb'
|
||||
@@ -1614,18 +1349,19 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/views/spree/admin/orders/edit.html.haml_spec.rb'
|
||||
- 'spec/views/spree/admin/orders/index.html.haml_spec.rb'
|
||||
|
||||
# Offense count: 50
|
||||
# Offense count: 51
|
||||
# Configuration parameters: MinBodyLength.
|
||||
Style/GuardClause:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/enterprises_controller.rb'
|
||||
- 'app/controllers/admin/order_cycles_controller.rb'
|
||||
- 'app/controllers/admin/product_import_controller.rb'
|
||||
- 'app/controllers/api/shipments_controller.rb'
|
||||
- 'app/controllers/application_controller.rb'
|
||||
- 'app/controllers/base_controller.rb'
|
||||
- 'app/controllers/checkout_controller.rb'
|
||||
- 'app/controllers/home_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/controllers/spree/paypal_controller_decorator.rb'
|
||||
- 'app/models/enterprise.rb'
|
||||
- 'app/models/enterprise_group.rb'
|
||||
- 'app/models/producer_property.rb'
|
||||
@@ -1645,48 +1381,19 @@ Style/GuardClause:
|
||||
- 'spec/support/request/distribution_helper.rb'
|
||||
- 'spec/support/request/shop_workflow.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Configuration parameters: AllowIfModifier.
|
||||
Style/IfInsideElse:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/column_preferences_controller.rb'
|
||||
- 'app/controllers/admin/variant_overrides_controller.rb'
|
||||
- 'app/controllers/api/taxons_controller.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: InverseMethods, InverseBlocks.
|
||||
Style/InverseMethods:
|
||||
Exclude:
|
||||
- 'lib/open_food_network/reports/line_items.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Style/MissingRespondToMissing:
|
||||
Exclude:
|
||||
- 'app/helpers/application_helper.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# Offense count: 4
|
||||
Style/MixinUsage:
|
||||
Exclude:
|
||||
- 'lib/open_food_network/orders_and_fulfillments_report.rb'
|
||||
- 'spec/features/admin/orders_spec.rb'
|
||||
- 'spec/lib/open_food_network/bulk_coop_report_spec.rb'
|
||||
- 'spec/lib/open_food_network/order_cycle_management_report_spec.rb'
|
||||
- 'spec/lib/open_food_network/packing_report_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Style/MultipleComparison:
|
||||
Exclude:
|
||||
- 'spec/models/product_importer_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: both, prefix, postfix
|
||||
Style/NegatedUnless:
|
||||
Exclude:
|
||||
- 'app/services/cart_service.rb'
|
||||
|
||||
# Offense count: 41
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
|
||||
@@ -1719,25 +1426,7 @@ Style/NumericPredicate:
|
||||
- 'lib/spree/money_decorator.rb'
|
||||
- 'lib/tasks/sample_data.rake'
|
||||
|
||||
# Offense count: 16
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
|
||||
# AllowedMethods: present?, blank?, presence, try, try!
|
||||
Style/SafeNavigation:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/payments_controller.rb'
|
||||
- 'app/controllers/spree/credit_cards_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/helpers/i18n_helper.rb'
|
||||
- 'app/helpers/shop_helper.rb'
|
||||
- 'app/models/producer_property.rb'
|
||||
- 'app/models/product_import/entry_validator.rb'
|
||||
- 'app/models/product_import/product_importer.rb'
|
||||
- 'app/models/proxy_order.rb'
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
- 'spec/factories.rb'
|
||||
|
||||
# Offense count: 232
|
||||
# Offense count: 231
|
||||
Style/Send:
|
||||
Exclude:
|
||||
- 'app/models/spree/shipping_method_decorator.rb'
|
||||
@@ -1757,7 +1446,6 @@ Style/Send:
|
||||
- 'spec/lib/open_food_network/permissions_spec.rb'
|
||||
- 'spec/lib/open_food_network/products_and_inventory_report_spec.rb'
|
||||
- 'spec/lib/open_food_network/sales_tax_report_spec.rb'
|
||||
- 'spec/lib/open_food_network/subscription_payment_updater_spec.rb'
|
||||
- 'spec/lib/open_food_network/tag_rule_applicator_spec.rb'
|
||||
- 'spec/lib/open_food_network/xero_invoices_report_spec.rb'
|
||||
- 'spec/lib/stripe/webhook_handler_spec.rb'
|
||||
|
||||
4
Gemfile
4
Gemfile
@@ -33,7 +33,7 @@ gem 'httparty', '~> 0.18' # Used to check alerts in spree_core, this is not used
|
||||
gem 'json', '>= 1.7.7'
|
||||
gem 'money', '5.1.1'
|
||||
gem 'paranoia', '~> 2.0'
|
||||
gem 'ransack', '~> 1.2.3'
|
||||
gem 'ransack', '~> 1.8.10'
|
||||
gem 'state_machine', '1.2.0'
|
||||
gem 'stringex', '~> 1.5.1'
|
||||
|
||||
@@ -79,7 +79,7 @@ gem 'actionpack-action_caching'
|
||||
# Once Rails is updated to 5.x we should bump directly to 0.10.x
|
||||
gem "active_model_serializers", "0.8.4"
|
||||
gem 'activerecord-session_store'
|
||||
gem 'acts-as-taggable-on', '~> 3.4'
|
||||
gem 'acts-as-taggable-on', '~> 4.0'
|
||||
gem 'angularjs-file-upload-rails', '~> 2.4.1'
|
||||
gem 'custom_error_message', github: 'jeremydurham/custom-err-msg'
|
||||
gem 'dalli'
|
||||
|
||||
21
Gemfile.lock
21
Gemfile.lock
@@ -124,8 +124,8 @@ GEM
|
||||
multi_json (~> 1.3)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo (~> 0.3.37)
|
||||
acts-as-taggable-on (3.5.0)
|
||||
activerecord (>= 3.2, < 5)
|
||||
acts-as-taggable-on (4.0.0)
|
||||
activerecord (>= 4.0)
|
||||
acts_as_list (0.2.0)
|
||||
activerecord (>= 3.0)
|
||||
addressable (2.7.0)
|
||||
@@ -406,7 +406,7 @@ GEM
|
||||
fuubar (2.5.0)
|
||||
rspec-core (~> 3.0)
|
||||
ruby-progressbar (~> 1.4)
|
||||
geocoder (1.5.2)
|
||||
geocoder (1.6.3)
|
||||
get_process_mem (0.2.5)
|
||||
ffi (~> 1.0)
|
||||
gmaps4rails (2.1.2)
|
||||
@@ -499,8 +499,6 @@ GEM
|
||||
paypal-sdk-merchant (1.106.1)
|
||||
paypal-sdk-core (~> 0.2.3)
|
||||
pg (0.21.0)
|
||||
polyamorous (1.0.0)
|
||||
activerecord (>= 3.0)
|
||||
power_assert (1.2.0)
|
||||
pry (0.12.2)
|
||||
coderay (~> 1.1.0)
|
||||
@@ -539,12 +537,11 @@ GEM
|
||||
rainbow (3.0.0)
|
||||
raindrops (0.19.1)
|
||||
rake (13.0.1)
|
||||
ransack (1.2.3)
|
||||
actionpack (>= 3.0)
|
||||
activerecord (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
ransack (1.8.10)
|
||||
actionpack (>= 3.0, < 5.2)
|
||||
activerecord (>= 3.0, < 5.2)
|
||||
activesupport (>= 3.0, < 5.2)
|
||||
i18n
|
||||
polyamorous (~> 1.0.0)
|
||||
rb-fsevent (0.10.3)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
@@ -696,7 +693,7 @@ DEPENDENCIES
|
||||
activerecord-import
|
||||
activerecord-postgresql-adapter
|
||||
activerecord-session_store
|
||||
acts-as-taggable-on (~> 3.4)
|
||||
acts-as-taggable-on (~> 4.0)
|
||||
acts_as_list (= 0.2.0)
|
||||
andand
|
||||
angular-rails-templates (~> 0.3.0)
|
||||
@@ -772,7 +769,7 @@ DEPENDENCIES
|
||||
rails (~> 4.0.13)
|
||||
rails-i18n (~> 4.0)
|
||||
rails_safe_tasks (~> 1.0)
|
||||
ransack (~> 1.2.3)
|
||||
ransack (~> 1.8.10)
|
||||
redcarpet
|
||||
roadie-rails (~> 1.3.0)
|
||||
roo (~> 2.8.3)
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
}
|
||||
|
||||
#cart-detail {
|
||||
width: 100%;
|
||||
|
||||
.cart-item-delete,
|
||||
.bought-item-delete {
|
||||
a {
|
||||
|
||||
@@ -28,7 +28,7 @@ module Admin
|
||||
# See https://github.com/rails/rails/blob/3-2-stable/activerecord/lib/active_record/locking/pessimistic.rb#L69
|
||||
# and https://www.postgresql.org/docs/current/static/sql-select.html#SQL-FOR-UPDATE-SHARE
|
||||
order.with_lock do
|
||||
if @line_item.update_attributes(line_item_params)
|
||||
if @line_item.update(line_item_params)
|
||||
order.update_distribution_charge!
|
||||
render nothing: true, status: :no_content # No Content, does not trigger ng resource auto-update
|
||||
else
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Admin
|
||||
class ColumnPreferencesController < ResourceController
|
||||
before_filter :load_collection, only: [:bulk_update]
|
||||
before_action :load_collection, only: [:bulk_update]
|
||||
|
||||
respond_to :json
|
||||
|
||||
@@ -9,12 +9,10 @@ module Admin
|
||||
|
||||
if @cp_set.save
|
||||
render json: @cp_set.collection, each_serializer: Api::Admin::ColumnPreferenceSerializer
|
||||
elsif @cp_set.errors.present?
|
||||
render json: { errors: @cp_set.errors }, status: :bad_request
|
||||
else
|
||||
if @cp_set.errors.present?
|
||||
render json: { errors: @cp_set.errors }, status: :bad_request
|
||||
else
|
||||
render nothing: true, status: :internal_server_error
|
||||
end
|
||||
render nothing: true, status: :internal_server_error
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ require 'open_food_network/address_finder'
|
||||
|
||||
module Admin
|
||||
class CustomersController < ResourceController
|
||||
before_filter :load_managed_shops, only: :index, if: :html_request?
|
||||
before_action :load_managed_shops, only: :index, if: :html_request?
|
||||
respond_to :json
|
||||
|
||||
respond_override update: { json: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Admin
|
||||
class EnterpriseFeesController < ResourceController
|
||||
before_filter :load_enterprise_fee_set, only: :index
|
||||
before_filter :load_data
|
||||
before_action :load_enterprise_fee_set, only: :index
|
||||
before_action :load_data
|
||||
|
||||
def index
|
||||
@include_calculators = params[:include_calculators].present?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Admin
|
||||
class EnterpriseGroupsController < ResourceController
|
||||
before_filter :load_data, except: :index
|
||||
before_filter :load_object_data, only: [:new, :edit, :create, :update]
|
||||
before_action :load_data, except: :index
|
||||
before_action :load_object_data, only: [:new, :edit, :create, :update]
|
||||
|
||||
def index
|
||||
@enterprise_groups = @enterprise_groups.managed_by(spree_current_user)
|
||||
|
||||
@@ -5,22 +5,22 @@ require 'open_food_network/order_cycle_permissions'
|
||||
module Admin
|
||||
class EnterprisesController < ResourceController
|
||||
# These need to run before #load_resource so that @object is initialised with sanitised values
|
||||
prepend_before_filter :override_owner, only: :create
|
||||
prepend_before_filter :override_sells, only: :create
|
||||
prepend_before_action :override_owner, only: :create
|
||||
prepend_before_action :override_sells, only: :create
|
||||
|
||||
before_filter :load_enterprise_set, only: :index
|
||||
before_filter :load_countries, except: [:index, :register, :check_permalink]
|
||||
before_filter :load_methods_and_fees, only: [:edit, :update]
|
||||
before_filter :load_groups, only: [:new, :edit, :update, :create]
|
||||
before_filter :load_taxons, only: [:new, :edit, :update, :create]
|
||||
before_filter :check_can_change_sells, only: :update
|
||||
before_filter :check_can_change_bulk_sells, only: :bulk_update
|
||||
before_filter :check_can_change_owner, only: :update
|
||||
before_filter :check_can_change_bulk_owner, only: :bulk_update
|
||||
before_filter :check_can_change_managers, only: :update
|
||||
before_filter :strip_new_properties, only: [:create, :update]
|
||||
before_filter :load_properties, only: [:edit, :update]
|
||||
before_filter :setup_property, only: [:edit]
|
||||
before_action :load_enterprise_set, only: :index
|
||||
before_action :load_countries, except: [:index, :register, :check_permalink]
|
||||
before_action :load_methods_and_fees, only: [:edit, :update]
|
||||
before_action :load_groups, only: [:new, :edit, :update, :create]
|
||||
before_action :load_taxons, only: [:new, :edit, :update, :create]
|
||||
before_action :check_can_change_sells, only: :update
|
||||
before_action :check_can_change_bulk_sells, only: :bulk_update
|
||||
before_action :check_can_change_owner, only: :update
|
||||
before_action :check_can_change_bulk_owner, only: :bulk_update
|
||||
before_action :check_can_change_managers, only: :update
|
||||
before_action :strip_new_properties, only: [:create, :update]
|
||||
before_action :load_properties, only: [:edit, :update]
|
||||
before_action :setup_property, only: [:edit]
|
||||
|
||||
helper 'spree/products'
|
||||
include OrderCyclesHelper
|
||||
@@ -47,7 +47,7 @@ module Admin
|
||||
tag_rules_attributes = params[object_name].delete :tag_rules_attributes
|
||||
update_tag_rules(tag_rules_attributes) if tag_rules_attributes.present?
|
||||
update_enterprise_notifications
|
||||
if @object.update_attributes(enterprise_params)
|
||||
if @object.update(enterprise_params)
|
||||
invoke_callbacks(:update, :after)
|
||||
flash[:success] = flash_message_for(@object, :successfully_updated)
|
||||
respond_with(@object) do |format|
|
||||
@@ -71,7 +71,7 @@ module Admin
|
||||
|
||||
attributes = { sells: params[:sells], visible: true }
|
||||
|
||||
if @enterprise.update_attributes(attributes)
|
||||
if @enterprise.update(attributes)
|
||||
flash[:success] = I18n.t(:enterprise_register_success_notice, enterprise: @enterprise.name)
|
||||
redirect_to admin_dashboard_path
|
||||
else
|
||||
@@ -214,7 +214,7 @@ module Admin
|
||||
rule = @object.tag_rules.find_by(id: attrs.delete(:id)) ||
|
||||
attrs[:type].constantize.new(enterprise: @object)
|
||||
create_calculator_for(rule, attrs) if rule.type == "TagRule::DiscountOrder" && rule.calculator.nil?
|
||||
rule.update_attributes(attrs)
|
||||
rule.update(attrs)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -227,7 +227,7 @@ module Admin
|
||||
|
||||
def create_calculator_for(rule, attrs)
|
||||
if attrs[:calculator_type].present? && attrs[:calculator_attributes].present?
|
||||
rule.update_attributes(calculator_type: attrs[:calculator_type])
|
||||
rule.update(calculator_type: attrs[:calculator_type])
|
||||
attrs[:calculator_attributes].merge!( id: rule.calculator.id )
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,12 +2,12 @@ module Admin
|
||||
class OrderCyclesController < ResourceController
|
||||
include OrderCyclesHelper
|
||||
|
||||
prepend_before_filter :set_order_cycle_id, only: [:incoming, :outgoing]
|
||||
before_filter :load_data_for_index, only: :index
|
||||
before_filter :require_coordinator, only: :new
|
||||
before_filter :remove_protected_attrs, only: [:update]
|
||||
before_filter :require_order_cycle_set_params, only: [:bulk_update]
|
||||
around_filter :protect_invalid_destroy, only: :destroy
|
||||
prepend_before_action :set_order_cycle_id, only: [:incoming, :outgoing]
|
||||
before_action :load_data_for_index, only: :index
|
||||
before_action :require_coordinator, only: :new
|
||||
before_action :remove_protected_attrs, only: [:update]
|
||||
before_action :require_order_cycle_set_params, only: [:bulk_update]
|
||||
around_action :protect_invalid_destroy, only: :destroy
|
||||
|
||||
def index
|
||||
respond_to do |format|
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module Admin
|
||||
class ProducerPropertiesController < ResourceController
|
||||
before_filter :load_enterprise
|
||||
before_filter :load_properties
|
||||
before_filter :setup_property, only: [:index]
|
||||
before_action :load_enterprise
|
||||
before_action :load_properties
|
||||
before_action :setup_property, only: [:index]
|
||||
|
||||
private
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ require 'roo'
|
||||
|
||||
module Admin
|
||||
class ProductImportController < Spree::Admin::BaseController
|
||||
before_filter :validate_upload_presence, except: %i[index guide validate_data]
|
||||
before_action :validate_upload_presence, except: %i[index guide validate_data]
|
||||
|
||||
def index
|
||||
@product_categories = Spree::Taxon.order('name ASC').pluck(:name).uniq
|
||||
|
||||
@@ -3,10 +3,10 @@ require 'order_management/subscriptions/proxy_order_syncer'
|
||||
|
||||
module Admin
|
||||
class SchedulesController < ResourceController
|
||||
before_filter :adapt_params, only: [:update]
|
||||
before_filter :editable_order_cycle_ids_for_create, only: [:create]
|
||||
before_filter :editable_order_cycle_ids_for_update, only: [:update]
|
||||
before_filter :check_dependent_subscriptions, only: [:destroy]
|
||||
before_action :adapt_params, only: [:update]
|
||||
before_action :editable_order_cycle_ids_for_create, only: [:create]
|
||||
before_action :editable_order_cycle_ids_for_update, only: [:update]
|
||||
before_action :check_dependent_subscriptions, only: [:destroy]
|
||||
update.after :sync_subscriptions_for_update
|
||||
|
||||
respond_to :json
|
||||
|
||||
@@ -4,7 +4,7 @@ module Admin
|
||||
class StripeConnectSettingsController < Spree::Admin::BaseController
|
||||
StripeConnectSettings = Struct.new(:stripe_connect_enabled)
|
||||
|
||||
before_filter :load_settings, only: [:edit]
|
||||
before_action :load_settings, only: [:edit]
|
||||
|
||||
def edit
|
||||
return @stripe_account = { status: :empty_api_key_error_html } if Stripe.api_key.blank?
|
||||
|
||||
@@ -4,9 +4,9 @@ require 'open_food_network/scope_variant_to_hub'
|
||||
|
||||
module Admin
|
||||
class SubscriptionLineItemsController < ResourceController
|
||||
before_filter :load_build_context, only: [:build]
|
||||
before_filter :ensure_shop, only: [:build]
|
||||
before_filter :ensure_variant, only: [:build]
|
||||
before_action :load_build_context, only: [:build]
|
||||
before_action :ensure_shop, only: [:build]
|
||||
before_action :ensure_variant, only: [:build]
|
||||
|
||||
respond_to :json
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ require 'open_food_network/permissions'
|
||||
|
||||
module Admin
|
||||
class SubscriptionsController < ResourceController
|
||||
before_filter :load_shops, only: [:index]
|
||||
before_filter :load_form_data, only: [:new, :edit]
|
||||
before_filter :strip_banned_attrs, only: [:update]
|
||||
before_filter :wrap_nested_attrs, only: [:create, :update]
|
||||
before_filter :check_for_open_orders, only: [:cancel, :pause]
|
||||
before_filter :check_for_canceled_orders, only: [:unpause]
|
||||
before_action :load_shops, only: [:index]
|
||||
before_action :load_form_data, only: [:new, :edit]
|
||||
before_action :strip_banned_attrs, only: [:update]
|
||||
before_action :wrap_nested_attrs, only: [:create, :update]
|
||||
before_action :check_for_open_orders, only: [:cancel, :pause]
|
||||
before_action :check_for_canceled_orders, only: [:unpause]
|
||||
respond_to :json
|
||||
|
||||
def index
|
||||
@@ -52,7 +52,7 @@ module Admin
|
||||
@subscription.proxy_orders.placed_and_open.each(&:cancel)
|
||||
end
|
||||
|
||||
@subscription.update_attributes(paused_at: Time.zone.now)
|
||||
@subscription.update(paused_at: Time.zone.now)
|
||||
render_as_json @subscription
|
||||
end
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ module Admin
|
||||
include OpenFoodNetwork::SpreeApiKeyLoader
|
||||
include EnterprisesHelper
|
||||
|
||||
prepend_before_filter :load_data
|
||||
before_filter :load_collection, only: [:bulk_update]
|
||||
before_filter :load_spree_api_key, only: :index
|
||||
prepend_before_action :load_data
|
||||
before_action :load_collection, only: [:bulk_update]
|
||||
before_action :load_spree_api_key, only: :index
|
||||
|
||||
def index; end
|
||||
|
||||
@@ -18,12 +18,10 @@ module Admin
|
||||
if @vo_set.save
|
||||
# Return saved VOs with IDs
|
||||
render json: @vo_set.collection, each_serializer: Api::Admin::VariantOverrideSerializer
|
||||
elsif @vo_set.errors.present?
|
||||
render json: { errors: @vo_set.errors }, status: :bad_request
|
||||
else
|
||||
if @vo_set.errors.present?
|
||||
render json: { errors: @vo_set.errors }, status: :bad_request
|
||||
else
|
||||
render nothing: true, status: :internal_server_error
|
||||
end
|
||||
render nothing: true, status: :internal_server_error
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ module Api
|
||||
|
||||
attr_accessor :current_api_user
|
||||
|
||||
before_filter :set_content_type
|
||||
before_filter :authenticate_user
|
||||
after_filter :set_jsonp_format
|
||||
before_action :set_content_type
|
||||
before_action :authenticate_user
|
||||
after_action :set_jsonp_format
|
||||
|
||||
rescue_from Exception, with: :error_during_processing
|
||||
rescue_from CanCan::AccessDenied, with: :unauthorized
|
||||
|
||||
@@ -11,7 +11,7 @@ module Api
|
||||
@customer = Customer.find(params[:id])
|
||||
authorize! :update, @customer
|
||||
|
||||
if @customer.update_attributes(params[:customer])
|
||||
if @customer.update(params[:customer])
|
||||
render json: @customer, serializer: CustomerSerializer, status: :ok
|
||||
else
|
||||
invalid_resource!(@customer)
|
||||
|
||||
@@ -7,14 +7,14 @@ module Api
|
||||
class MissingImplementationError < StandardError; end
|
||||
class UnknownEnterpriseAuthorizationActionError < StandardError; end
|
||||
|
||||
before_filter :load_enterprise
|
||||
before_action :load_enterprise
|
||||
|
||||
respond_to :json
|
||||
|
||||
def destroy
|
||||
return respond_with_conflict(error: destroy_attachment_does_not_exist_error_message) unless @enterprise.public_send("#{attachment_name}?")
|
||||
|
||||
@enterprise.update_attributes!(attachment_name => nil)
|
||||
@enterprise.update!(attachment_name => nil)
|
||||
render json: @enterprise, serializer: Admin::EnterpriseSerializer, spree_current_user: spree_current_user
|
||||
end
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module Api
|
||||
class EnterprisesController < Api::BaseController
|
||||
before_filter :override_owner, only: [:create, :update]
|
||||
before_filter :check_type, only: :update
|
||||
before_filter :override_sells, only: [:create, :update]
|
||||
before_filter :override_visible, only: [:create, :update]
|
||||
before_action :override_owner, only: [:create, :update]
|
||||
before_action :check_type, only: :update
|
||||
before_action :override_sells, only: [:create, :update]
|
||||
before_action :override_visible, only: [:create, :update]
|
||||
respond_to :json
|
||||
|
||||
def create
|
||||
@@ -25,7 +25,7 @@ module Api
|
||||
@enterprise = Enterprise.find_by(permalink: params[:id]) || Enterprise.find(params[:id])
|
||||
authorize! :update, @enterprise
|
||||
|
||||
if @enterprise.update_attributes(params[:enterprise])
|
||||
if @enterprise.update(params[:enterprise])
|
||||
render text: @enterprise.id, status: :ok
|
||||
else
|
||||
invalid_resource!(@enterprise)
|
||||
@@ -36,9 +36,9 @@ module Api
|
||||
@enterprise = Enterprise.find_by(permalink: params[:id]) || Enterprise.find(params[:id])
|
||||
authorize! :update, @enterprise
|
||||
|
||||
if params[:logo] && @enterprise.update_attributes( logo: params[:logo] )
|
||||
if params[:logo] && @enterprise.update( logo: params[:logo] )
|
||||
render text: @enterprise.logo.url(:medium), status: :ok
|
||||
elsif params[:promo] && @enterprise.update_attributes( promo_image: params[:promo] )
|
||||
elsif params[:promo] && @enterprise.update( promo_image: params[:promo] )
|
||||
render text: @enterprise.promo_image.url(:medium), status: :ok
|
||||
else
|
||||
invalid_resource!(@enterprise)
|
||||
|
||||
@@ -4,7 +4,7 @@ module Api
|
||||
include ApiActionCaching
|
||||
|
||||
skip_authorization_check
|
||||
skip_before_filter :authenticate_user, :ensure_api_key, only: [:taxons, :properties]
|
||||
skip_before_action :authenticate_user, :ensure_api_key, only: [:taxons, :properties]
|
||||
|
||||
caches_action :taxons, :properties,
|
||||
expires_in: CacheService::FILTERS_EXPIRY,
|
||||
|
||||
@@ -11,7 +11,7 @@ module Api
|
||||
render json: @image, serializer: ImageSerializer, status: :created
|
||||
else
|
||||
@image = @product.images.first
|
||||
@image.update_attributes(attachment: params[:file])
|
||||
@image.update(attachment: params[:file])
|
||||
render json: @image, serializer: ImageSerializer, status: :ok
|
||||
end
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@ module Api
|
||||
def update
|
||||
authorize! :update, Spree::Product
|
||||
@product = find_product(params[:id])
|
||||
if @product.update_attributes(params[:product])
|
||||
if @product.update(params[:product])
|
||||
render json: @product, serializer: Api::Admin::ProductSerializer, status: :ok
|
||||
else
|
||||
invalid_resource!(@product)
|
||||
|
||||
@@ -4,8 +4,8 @@ module Api
|
||||
class ShipmentsController < Api::BaseController
|
||||
respond_to :json
|
||||
|
||||
before_filter :find_order
|
||||
before_filter :find_and_update_shipment, only: [:ship, :ready, :add, :remove]
|
||||
before_action :find_order
|
||||
before_action :find_and_update_shipment, only: [:ship, :ready, :add, :remove]
|
||||
|
||||
def create
|
||||
variant = scoped_variant(params[:variant_id])
|
||||
@@ -30,7 +30,7 @@ module Api
|
||||
@shipment.adjustment.open
|
||||
end
|
||||
|
||||
@shipment.update_attributes(params[:shipment])
|
||||
@shipment.update(params[:shipment])
|
||||
|
||||
if unlock == 'yes'
|
||||
@shipment.adjustment.close
|
||||
@@ -88,7 +88,7 @@ module Api
|
||||
|
||||
def find_and_update_shipment
|
||||
@shipment = @order.shipments.find_by!(number: params[:id])
|
||||
@shipment.update_attributes(params[:shipment])
|
||||
@shipment.update(params[:shipment])
|
||||
@shipment.reload
|
||||
end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ module Api
|
||||
skip_authorization_check only: [:show, :closed_shops]
|
||||
|
||||
def show
|
||||
enterprise = Enterprise.find_by_id(params[:id])
|
||||
enterprise = Enterprise.find_by(id: params[:id])
|
||||
|
||||
render text: Api::EnterpriseShopfrontSerializer.new(enterprise).to_json, status: :ok
|
||||
end
|
||||
|
||||
@@ -5,15 +5,13 @@ module Api
|
||||
skip_authorization_check only: [:index, :show, :jstree]
|
||||
|
||||
def index
|
||||
if taxonomy
|
||||
@taxons = taxonomy.root.children
|
||||
else
|
||||
if params[:ids]
|
||||
@taxons = Spree::Taxon.where(id: params[:ids].split(","))
|
||||
else
|
||||
@taxons = Spree::Taxon.ransack(params[:q]).result
|
||||
end
|
||||
end
|
||||
@taxons = if taxonomy
|
||||
taxonomy.root.children
|
||||
elsif params[:ids]
|
||||
Spree::Taxon.where(id: params[:ids].split(","))
|
||||
else
|
||||
Spree::Taxon.ransack(params[:q]).result
|
||||
end
|
||||
render json: @taxons, each_serializer: Api::TaxonSerializer
|
||||
end
|
||||
|
||||
@@ -44,7 +42,7 @@ module Api
|
||||
|
||||
def update
|
||||
authorize! :update, Spree::Taxon
|
||||
if taxon.update_attributes(params[:taxon])
|
||||
if taxon.update(params[:taxon])
|
||||
render json: taxon, serializer: Api::TaxonSerializer, status: :ok
|
||||
else
|
||||
invalid_resource!(taxon)
|
||||
|
||||
@@ -3,7 +3,7 @@ module Api
|
||||
respond_to :json
|
||||
|
||||
skip_authorization_check only: [:index, :show]
|
||||
before_filter :product
|
||||
before_action :product
|
||||
|
||||
def index
|
||||
@variants = scope.includes(option_values: :option_type).ransack(params[:q]).result
|
||||
@@ -28,7 +28,7 @@ module Api
|
||||
def update
|
||||
authorize! :update, Spree::Variant
|
||||
@variant = scope.find(params[:id])
|
||||
if @variant.update_attributes(params[:variant])
|
||||
if @variant.update(params[:variant])
|
||||
render json: @variant, serializer: Api::VariantSerializer, status: :ok
|
||||
else
|
||||
invalid_resource!(@product)
|
||||
|
||||
@@ -4,8 +4,8 @@ require_dependency 'spree/authentication_helpers'
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
|
||||
prepend_before_filter :restrict_iframes
|
||||
before_filter :set_cache_headers # prevent cart emptying via cache when using back button #1213
|
||||
prepend_before_action :restrict_iframes
|
||||
before_action :set_cache_headers # prevent cart emptying via cache when using back button #1213
|
||||
|
||||
include EnterprisesHelper
|
||||
include Spree::AuthenticationHelpers
|
||||
@@ -99,8 +99,7 @@ class ApplicationController < ActionController::Base
|
||||
if current_distributor_closed?
|
||||
current_order.empty!
|
||||
current_order.set_distribution! nil, nil
|
||||
flash[:info] = "The hub you have selected is temporarily closed for orders. "\
|
||||
"Please try again later."
|
||||
flash[:info] = I18n.t('order_cycles_closed_for_hub')
|
||||
redirect_to main_app.root_url
|
||||
end
|
||||
end
|
||||
@@ -117,7 +116,7 @@ class ApplicationController < ActionController::Base
|
||||
session[:expired_order_cycle_id] = current_order_cycle.id
|
||||
current_order.empty!
|
||||
current_order.set_order_cycle! nil
|
||||
flash[:info] = "The order cycle you've selected has just closed. Please try again!"
|
||||
flash[:info] = I18n.t('order_cycle_closed')
|
||||
redirect_to main_app.root_url
|
||||
end
|
||||
end
|
||||
@@ -134,7 +133,8 @@ class ApplicationController < ActionController::Base
|
||||
nil
|
||||
end
|
||||
|
||||
def set_cache_headers # https://jacopretorius.net/2014/01/force-page-to-reload-on-browser-back-in-rails.html
|
||||
# See https://jacopretorius.net/2014/01/force-page-to-reload-on-browser-back-in-rails.html
|
||||
def set_cache_headers
|
||||
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
|
||||
response.headers["Pragma"] = "no-cache"
|
||||
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
|
||||
|
||||
@@ -14,8 +14,8 @@ class BaseController < ApplicationController
|
||||
|
||||
helper 'spree/base'
|
||||
|
||||
before_filter :set_locale
|
||||
before_filter :check_order_cycle_expiry
|
||||
before_action :set_locale
|
||||
before_action :check_order_cycle_expiry
|
||||
|
||||
private
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require 'spree/core/controller_helpers/order_decorator'
|
||||
|
||||
class CartController < BaseController
|
||||
before_filter :check_authorization
|
||||
before_action :check_authorization
|
||||
|
||||
def populate
|
||||
order = current_order(true)
|
||||
|
||||
@@ -13,22 +13,22 @@ class CheckoutController < Spree::StoreController
|
||||
|
||||
# We need pessimistic locking to avoid race conditions.
|
||||
# Otherwise we fail on duplicate indexes or end up with negative stock.
|
||||
prepend_around_filter CurrentOrderLocker, only: :update
|
||||
prepend_around_action CurrentOrderLocker, only: :update
|
||||
|
||||
prepend_before_filter :check_hub_ready_for_checkout
|
||||
prepend_before_filter :check_order_cycle_expiry
|
||||
prepend_before_filter :require_order_cycle
|
||||
prepend_before_filter :require_distributor_chosen
|
||||
prepend_before_action :check_hub_ready_for_checkout
|
||||
prepend_before_action :check_order_cycle_expiry
|
||||
prepend_before_action :require_order_cycle
|
||||
prepend_before_action :require_distributor_chosen
|
||||
|
||||
before_filter :load_order
|
||||
before_action :load_order
|
||||
|
||||
before_filter :ensure_order_not_completed
|
||||
before_filter :ensure_checkout_allowed
|
||||
before_filter :ensure_sufficient_stock_lines
|
||||
before_action :ensure_order_not_completed
|
||||
before_action :ensure_checkout_allowed
|
||||
before_action :ensure_sufficient_stock_lines
|
||||
|
||||
before_filter :associate_user
|
||||
before_filter :check_authorization
|
||||
before_filter :enable_embedded_shopfront
|
||||
before_action :associate_user
|
||||
before_action :check_authorization
|
||||
before_action :enable_embedded_shopfront
|
||||
|
||||
helper 'spree/orders'
|
||||
|
||||
@@ -45,7 +45,7 @@ class CheckoutController < Spree::StoreController
|
||||
|
||||
def update
|
||||
params_adapter = Checkout::FormDataAdapter.new(permitted_params, @order, spree_current_user)
|
||||
return update_failed unless @order.update_attributes(params_adapter.params[:order])
|
||||
return update_failed unless @order.update(params_adapter.params[:order])
|
||||
|
||||
fire_event('spree.checkout.update')
|
||||
|
||||
@@ -91,6 +91,7 @@ class CheckoutController < Spree::StoreController
|
||||
|
||||
redirect_to(main_app.shop_path) && return if redirect_to_shop?
|
||||
redirect_to_cart_path && return unless valid_order_line_items?
|
||||
|
||||
before_address
|
||||
setup_for_current_state
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ class DiscourseSsoController < ApplicationController
|
||||
include SharedHelper
|
||||
include DiscourseHelper
|
||||
|
||||
before_filter :require_config
|
||||
before_action :require_config
|
||||
|
||||
def login
|
||||
if require_activation?
|
||||
|
||||
@@ -7,10 +7,10 @@ class EnterprisesController < BaseController
|
||||
include SerializerHelper
|
||||
|
||||
# These prepended filters are in the reverse order of execution
|
||||
prepend_before_filter :set_order_cycles, :require_distributor_chosen, :reset_order, only: :shop
|
||||
prepend_before_action :set_order_cycles, :require_distributor_chosen, :reset_order, only: :shop
|
||||
|
||||
before_filter :clean_permalink, only: :check_permalink
|
||||
before_filter :enable_embedded_shopfront
|
||||
before_action :clean_permalink, only: :check_permalink
|
||||
before_action :enable_embedded_shopfront
|
||||
|
||||
respond_to :js, only: :permalink_checker
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class HomeController < BaseController
|
||||
layout 'darkswarm'
|
||||
|
||||
before_filter :enable_embedded_shopfront
|
||||
before_action :enable_embedded_shopfront
|
||||
|
||||
def index
|
||||
if ContentConfig.home_show_stats
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class LineItemsController < BaseController
|
||||
respond_to :json
|
||||
|
||||
before_filter :load_line_item, only: :destroy
|
||||
before_action :load_line_item, only: :destroy
|
||||
|
||||
def bought
|
||||
respond_with bought_items, each_serializer: Api::LineItemSerializer
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class ProducersController < BaseController
|
||||
layout 'darkswarm'
|
||||
|
||||
before_filter :enable_embedded_shopfront
|
||||
before_action :enable_embedded_shopfront
|
||||
|
||||
def index
|
||||
@enterprises = Enterprise
|
||||
|
||||
@@ -2,8 +2,8 @@ require 'open_food_network/spree_api_key_loader'
|
||||
|
||||
class RegistrationController < BaseController
|
||||
include OpenFoodNetwork::SpreeApiKeyLoader
|
||||
before_filter :load_spree_api_key, only: [:index]
|
||||
before_filter :check_user, except: :authenticate
|
||||
before_action :load_spree_api_key, only: [:index]
|
||||
before_action :check_user, except: :authenticate
|
||||
layout 'registration'
|
||||
|
||||
def index
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class ShopController < BaseController
|
||||
layout "darkswarm"
|
||||
before_filter :require_distributor_chosen, :set_order_cycles, except: :changeable_orders_alert
|
||||
before_filter :enable_embedded_shopfront
|
||||
before_action :require_distributor_chosen, :set_order_cycles, except: :changeable_orders_alert
|
||||
before_action :enable_embedded_shopfront
|
||||
|
||||
def show
|
||||
redirect_to main_app.enterprise_shop_path(current_distributor)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class ShopsController < BaseController
|
||||
layout 'darkswarm'
|
||||
|
||||
before_filter :enable_embedded_shopfront
|
||||
before_action :enable_embedded_shopfront
|
||||
|
||||
def index
|
||||
@enterprises = ShopsListService.new.open_shops
|
||||
|
||||
@@ -4,9 +4,9 @@ module Spree
|
||||
belongs_to 'spree/order', find_by: :number
|
||||
destroy.after :reload_order
|
||||
|
||||
prepend_before_filter :set_included_tax, only: [:create, :update]
|
||||
before_filter :set_default_tax_rate, only: :edit
|
||||
before_filter :enable_updates, only: :update
|
||||
prepend_before_action :set_included_tax, only: [:create, :update]
|
||||
before_action :set_default_tax_rate, only: :edit
|
||||
before_action :enable_updates, only: :update
|
||||
|
||||
private
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ module Spree
|
||||
|
||||
include I18nHelper
|
||||
|
||||
before_filter :authorize_admin
|
||||
before_filter :set_locale
|
||||
before_filter :warn_invalid_order_cycles, if: :html_request?
|
||||
before_action :authorize_admin
|
||||
before_action :set_locale
|
||||
before_action :warn_invalid_order_cycles, if: :html_request?
|
||||
|
||||
# Warn the user when they have an active order cycle with hubs that are not ready
|
||||
# for checkout (ie. does not have valid shipping and payment methods).
|
||||
|
||||
@@ -6,7 +6,7 @@ module Spree
|
||||
# See here https://github.com/spree/spree/commit/334a011d2b8e16355e4ae77ae07cd93f7cbc8fd1
|
||||
belongs_to 'spree/product', find_by: :permalink
|
||||
|
||||
before_filter :load_data
|
||||
before_action :load_data
|
||||
|
||||
create.before :set_viewable
|
||||
update.before :set_viewable
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Spree
|
||||
module Admin
|
||||
class MailMethodsController < Spree::Admin::BaseController
|
||||
after_filter :initialize_mail_settings
|
||||
after_action :initialize_mail_settings
|
||||
|
||||
def update
|
||||
params.each do |name, value|
|
||||
|
||||
@@ -2,9 +2,9 @@ module Spree
|
||||
module Admin
|
||||
module Orders
|
||||
class CustomerDetailsController < Spree::Admin::BaseController
|
||||
before_filter :load_order
|
||||
before_filter :check_authorization
|
||||
before_filter :set_guest_checkout_status, only: :update
|
||||
before_action :load_order
|
||||
before_action :check_authorization
|
||||
before_action :set_guest_checkout_status, only: :update
|
||||
|
||||
def show
|
||||
edit
|
||||
@@ -18,7 +18,7 @@ module Spree
|
||||
end
|
||||
|
||||
def update
|
||||
if @order.update_attributes(order_params)
|
||||
if @order.update(order_params)
|
||||
if params[:guest_checkout] == "false"
|
||||
@order.associate_user!(Spree.user_class.find_by(email: @order.email))
|
||||
end
|
||||
|
||||
@@ -7,21 +7,21 @@ module Spree
|
||||
include OpenFoodNetwork::SpreeApiKeyLoader
|
||||
helper CheckoutHelper
|
||||
|
||||
before_filter :load_order, only: [:edit, :update, :fire, :resend,
|
||||
before_action :load_order, only: [:edit, :update, :fire, :resend,
|
||||
:invoice, :print, :print_ticket]
|
||||
before_filter :load_distribution_choices, only: [:new, :edit, :update]
|
||||
before_action :load_distribution_choices, only: [:new, :edit, :update]
|
||||
|
||||
# Ensure that the distributor is set for an order when
|
||||
before_filter :ensure_distribution, only: :new
|
||||
before_action :ensure_distribution, only: :new
|
||||
|
||||
# After updating an order, the fees should be updated as well
|
||||
# Currently, adding or deleting line items does not trigger updating the
|
||||
# fees! This is a quick fix for that.
|
||||
# TODO: update fees when adding/removing line items
|
||||
# instead of the update_distribution_charge method.
|
||||
after_filter :update_distribution_charge, only: :update
|
||||
after_action :update_distribution_charge, only: :update
|
||||
|
||||
before_filter :require_distributor_abn, only: :invoice
|
||||
before_action :require_distributor_abn, only: :invoice
|
||||
|
||||
respond_to :html, :json
|
||||
|
||||
@@ -44,7 +44,7 @@ module Spree
|
||||
end
|
||||
|
||||
def update
|
||||
unless @order.update_attributes(order_params) && @order.line_items.present?
|
||||
unless @order.update(order_params) && @order.line_items.present?
|
||||
if @order.line_items.empty?
|
||||
@order.errors.add(:line_items, Spree.t('errors.messages.blank'))
|
||||
end
|
||||
@@ -117,7 +117,7 @@ module Spree
|
||||
def load_order
|
||||
if params[:id]
|
||||
@order = Order.includes(:adjustments, :shipments, line_items: :adjustments).
|
||||
find_by_number!(params[:id])
|
||||
find_by!(number: params[:id])
|
||||
end
|
||||
authorize! action, @order
|
||||
end
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module Spree
|
||||
module Admin
|
||||
class PaymentMethodsController < ResourceController
|
||||
skip_before_filter :load_resource, only: [:create, :show_provider_preferences]
|
||||
before_filter :load_data
|
||||
before_filter :validate_payment_method_provider, only: [:create]
|
||||
before_filter :load_hubs, only: [:new, :edit, :update]
|
||||
skip_before_action :load_resource, only: [:create, :show_provider_preferences]
|
||||
before_action :load_data
|
||||
before_action :validate_payment_method_provider, only: [:create]
|
||||
before_action :load_hubs, only: [:new, :edit, :update]
|
||||
create.before :load_hubs
|
||||
|
||||
respond_to :html
|
||||
@@ -40,7 +40,7 @@ module Spree
|
||||
@payment_method = PaymentMethod.find(params[:id])
|
||||
end
|
||||
|
||||
if @payment_method.update_attributes(params_for_update)
|
||||
if @payment_method.update(params_for_update)
|
||||
invoke_callbacks(:update, :after)
|
||||
flash[:success] = Spree.t(:successfully_updated, resource: Spree.t(:payment_method))
|
||||
redirect_to edit_admin_payment_method_path(@payment_method)
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
module Spree
|
||||
module Admin
|
||||
class PaymentsController < Spree::Admin::BaseController
|
||||
before_filter :load_order, except: [:show]
|
||||
before_filter :load_payment, only: [:fire, :show]
|
||||
before_filter :load_data
|
||||
before_filter :can_transition_to_payment
|
||||
before_action :load_order, except: [:show]
|
||||
before_action :load_payment, only: [:fire, :show]
|
||||
before_action :load_data
|
||||
before_action :can_transition_to_payment
|
||||
|
||||
respond_to :html
|
||||
|
||||
@@ -122,7 +122,7 @@ module Spree
|
||||
end
|
||||
|
||||
def load_order
|
||||
@order = Order.find_by_number!(params[:order_id])
|
||||
@order = Order.find_by!(number: params[:order_id])
|
||||
authorize! action, @order
|
||||
@order
|
||||
end
|
||||
|
||||
@@ -2,8 +2,8 @@ module Spree
|
||||
module Admin
|
||||
class ProductPropertiesController < ResourceController
|
||||
belongs_to 'spree/product', find_by: :permalink
|
||||
before_filter :find_properties
|
||||
before_filter :setup_property, only: [:index]
|
||||
before_action :find_properties
|
||||
before_action :setup_property, only: [:index]
|
||||
|
||||
private
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ module Spree
|
||||
create.before :create_before
|
||||
update.before :update_before
|
||||
|
||||
before_filter :load_data
|
||||
before_filter :load_form_data, only: [:index, :new, :create, :edit, :update]
|
||||
before_filter :load_spree_api_key, only: [:index, :variant_overrides]
|
||||
before_filter :strip_new_properties, only: [:create, :update]
|
||||
before_action :load_data
|
||||
before_action :load_form_data, only: [:index, :new, :create, :edit, :update]
|
||||
before_action :load_spree_api_key, only: [:index, :variant_overrides]
|
||||
before_action :strip_new_properties, only: [:create, :update]
|
||||
|
||||
respond_override create: { html: {
|
||||
success: lambda {
|
||||
@@ -96,7 +96,7 @@ module Spree
|
||||
protected
|
||||
|
||||
def find_resource
|
||||
Product.find_by_permalink!(params[:id])
|
||||
Product.find_by!(permalink: params[:id])
|
||||
end
|
||||
|
||||
def location_after_save
|
||||
|
||||
@@ -27,9 +27,9 @@ module Spree
|
||||
|
||||
helper_method :render_content?
|
||||
|
||||
before_filter :cache_search_state
|
||||
before_action :cache_search_state
|
||||
# Fetches user's distributors, suppliers and order_cycles
|
||||
before_filter :load_data,
|
||||
before_action :load_data,
|
||||
only: [:customers, :products_and_inventory, :order_cycle_management, :packing]
|
||||
|
||||
respond_to :html
|
||||
|
||||
@@ -4,7 +4,7 @@ module Spree
|
||||
module Admin
|
||||
class ResourceController < Spree::Admin::BaseController
|
||||
helper_method :new_object_url, :edit_object_url, :object_url, :collection_url
|
||||
before_filter :load_resource, except: [:update_positions]
|
||||
before_action :load_resource, except: [:update_positions]
|
||||
rescue_from ActiveRecord::RecordNotFound, with: :resource_not_found
|
||||
rescue_from CanCan::AccessDenied, with: :unauthorized
|
||||
|
||||
@@ -28,7 +28,7 @@ module Spree
|
||||
|
||||
def update
|
||||
invoke_callbacks(:update, :before)
|
||||
if @object.update_attributes(permitted_resource_params)
|
||||
if @object.update(permitted_resource_params)
|
||||
invoke_callbacks(:update, :after)
|
||||
flash[:success] = flash_message_for(@object, :successfully_updated)
|
||||
respond_with(@object) do |format|
|
||||
|
||||
@@ -2,7 +2,7 @@ module Spree
|
||||
module Admin
|
||||
class SearchController < Spree::Admin::BaseController
|
||||
# http://spreecommerce.com/blog/2010/11/02/json-hijacking-vulnerability/
|
||||
before_filter :check_json_authenticity, only: :index
|
||||
before_action :check_json_authenticity, only: :index
|
||||
respond_to :json
|
||||
|
||||
def known_users
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module Spree
|
||||
module Admin
|
||||
class ShippingMethodsController < ResourceController
|
||||
before_filter :load_data, except: [:index]
|
||||
before_filter :set_shipping_category, only: [:create, :update]
|
||||
before_filter :set_zones, only: [:create, :update]
|
||||
before_filter :load_hubs, only: [:new, :edit, :create, :update]
|
||||
before_action :load_data, except: [:index]
|
||||
before_action :set_shipping_category, only: [:create, :update]
|
||||
before_action :set_zones, only: [:create, :update]
|
||||
before_action :load_hubs, only: [:new, :edit, :create, :update]
|
||||
|
||||
# Sort shipping methods by distributor name
|
||||
def collection
|
||||
|
||||
@@ -2,7 +2,7 @@ module Spree
|
||||
module Admin
|
||||
class StatesController < ResourceController
|
||||
belongs_to 'spree/country'
|
||||
before_filter :load_data
|
||||
before_action :load_data
|
||||
|
||||
def index
|
||||
respond_with(@collection) do |format|
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Spree
|
||||
module Admin
|
||||
class TaxRatesController < ResourceController
|
||||
before_filter :load_data
|
||||
before_action :load_data
|
||||
|
||||
update.after :update_after
|
||||
create.after :create_after
|
||||
|
||||
@@ -81,7 +81,7 @@ module Spree
|
||||
@update_children = true
|
||||
end
|
||||
|
||||
if @taxon.update_attributes(taxon_params)
|
||||
if @taxon.update(taxon_params)
|
||||
flash[:success] = flash_message_for(@taxon, :successfully_updated)
|
||||
end
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ module Spree
|
||||
class UsersController < ResourceController
|
||||
rescue_from Spree::User::DestroyWithOrdersError, with: :user_destroy_with_orders_error
|
||||
|
||||
after_filter :sign_in_if_change_own_password, only: :update
|
||||
after_action :sign_in_if_change_own_password, only: :update
|
||||
|
||||
# http://spreecommerce.com/blog/2010/11/02/json-hijacking-vulnerability/
|
||||
before_filter :check_json_authenticity, only: :index
|
||||
before_filter :load_roles, only: [:edit, :new, :update, :create,
|
||||
before_action :check_json_authenticity, only: :index
|
||||
before_action :load_roles, only: [:edit, :new, :update, :create,
|
||||
:generate_api_key, :clear_api_key]
|
||||
|
||||
def index
|
||||
@@ -41,7 +41,7 @@ module Spree
|
||||
roles = params[:user].delete("spree_role_ids")
|
||||
end
|
||||
|
||||
if @user.update_attributes(user_params)
|
||||
if @user.update(user_params)
|
||||
if roles
|
||||
@user.spree_roles = roles.reject(&:blank?).collect{ |r| Spree::Role.find(r) }
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Spree
|
||||
module Admin
|
||||
class ZonesController < ResourceController
|
||||
before_filter :load_data, except: [:index]
|
||||
before_action :load_data, except: [:index]
|
||||
|
||||
def new
|
||||
@zone.zone_members.build
|
||||
|
||||
@@ -26,7 +26,7 @@ module Spree
|
||||
|
||||
authorize! :update, @credit_card
|
||||
|
||||
if @credit_card.update_attributes(credit_card_params)
|
||||
if @credit_card.update(credit_card_params)
|
||||
render json: @credit_card, serializer: ::Api::CreditCardSerializer, status: :ok
|
||||
else
|
||||
update_failed
|
||||
@@ -60,12 +60,12 @@ module Spree
|
||||
def destroy_at_stripe
|
||||
stripe_customer = Stripe::Customer.retrieve(@credit_card.gateway_customer_profile_id, {})
|
||||
|
||||
stripe_customer.delete if stripe_customer
|
||||
stripe_customer&.delete
|
||||
end
|
||||
|
||||
def stripe_account_id
|
||||
StripeAccount.
|
||||
find_by_enterprise_id(@credit_card.payment_method.preferred_enterprise_id).
|
||||
find_by(enterprise_id: @credit_card.payment_method.preferred_enterprise_id).
|
||||
andand.
|
||||
stripe_user_id
|
||||
end
|
||||
|
||||
@@ -8,22 +8,22 @@ module Spree
|
||||
|
||||
ssl_required :show
|
||||
|
||||
before_filter :check_authorization
|
||||
before_action :check_authorization
|
||||
rescue_from ActiveRecord::RecordNotFound, with: :render_404
|
||||
helper 'spree/products', 'spree/orders'
|
||||
|
||||
respond_to :html
|
||||
respond_to :json
|
||||
|
||||
before_filter :update_distribution, only: :update
|
||||
before_filter :filter_order_params, only: :update
|
||||
before_filter :enable_embedded_shopfront
|
||||
before_action :update_distribution, only: :update
|
||||
before_action :filter_order_params, only: :update
|
||||
before_action :enable_embedded_shopfront
|
||||
|
||||
prepend_before_filter :require_order_authentication, only: :show
|
||||
prepend_before_filter :require_order_cycle, only: :edit
|
||||
prepend_before_filter :require_distributor_chosen, only: :edit
|
||||
before_filter :check_hub_ready_for_checkout, only: :edit
|
||||
before_filter :check_at_least_one_line_item, only: :update
|
||||
prepend_before_action :require_order_authentication, only: :show
|
||||
prepend_before_action :require_order_cycle, only: :edit
|
||||
prepend_before_action :require_distributor_chosen, only: :edit
|
||||
before_action :check_hub_ready_for_checkout, only: :edit
|
||||
before_action :check_at_least_one_line_item, only: :update
|
||||
|
||||
def show
|
||||
@order = Spree::Order.find_by!(number: params[:id])
|
||||
@@ -74,7 +74,7 @@ module Spree
|
||||
redirect_to(main_app.root_path) && return
|
||||
end
|
||||
|
||||
if @order.update_attributes(order_params)
|
||||
if @order.update(order_params)
|
||||
discard_empty_line_items
|
||||
with_open_adjustments { update_totals_and_taxes }
|
||||
|
||||
@@ -166,7 +166,7 @@ module Spree
|
||||
# recalculates the shipment taxes
|
||||
def update_totals_and_taxes
|
||||
@order.updater.update_totals
|
||||
@order.shipment.ensure_correct_adjustment_with_included_tax if @order.shipment
|
||||
@order.shipment&.ensure_correct_adjustment_with_included_tax
|
||||
end
|
||||
|
||||
# Sets the adjustments to open to perform the block's action and restores
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Spree::PaypalController.class_eval do
|
||||
before_filter :enable_embedded_shopfront
|
||||
before_filter :destroy_orphaned_paypal_payments, only: :confirm
|
||||
after_filter :reset_order_when_complete, only: :confirm
|
||||
before_filter :permit_parameters!
|
||||
before_action :enable_embedded_shopfront
|
||||
before_action :destroy_orphaned_paypal_payments, only: :confirm
|
||||
after_action :reset_order_when_complete, only: :confirm
|
||||
before_action :permit_parameters!
|
||||
|
||||
def cancel
|
||||
flash[:notice] = Spree.t('flash.cancel', scope: 'paypal')
|
||||
|
||||
@@ -5,7 +5,7 @@ module Spree
|
||||
include Spree::Core::ControllerHelpers::Order
|
||||
|
||||
include I18nHelper
|
||||
before_filter :set_locale
|
||||
before_action :set_locale
|
||||
|
||||
def unauthorized
|
||||
render 'shared/unauthorized', status: :unauthorized
|
||||
|
||||
@@ -8,8 +8,8 @@ module Spree
|
||||
include Spree::Core::ControllerHelpers::SSL
|
||||
|
||||
ssl_required
|
||||
before_filter :check_permissions, only: [:edit, :update]
|
||||
skip_before_filter :require_no_authentication
|
||||
before_action :check_permissions, only: [:edit, :update]
|
||||
skip_before_action :require_no_authentication
|
||||
|
||||
# GET /resource/sign_up
|
||||
def new
|
||||
|
||||
@@ -10,7 +10,7 @@ module Spree
|
||||
ssl_required :new, :create, :destroy, :update
|
||||
ssl_allowed :login_bar
|
||||
|
||||
before_filter :set_checkout_redirect, only: :create
|
||||
before_action :set_checkout_redirect, only: :create
|
||||
|
||||
def create
|
||||
authenticate_spree_user!
|
||||
|
||||
@@ -2,15 +2,15 @@ module Spree
|
||||
class UsersController < Spree::StoreController
|
||||
layout 'darkswarm'
|
||||
ssl_required
|
||||
skip_before_filter :set_current_order, only: :show
|
||||
prepend_before_filter :load_object, only: [:show, :edit, :update]
|
||||
prepend_before_filter :authorize_actions, only: :new
|
||||
skip_before_action :set_current_order, only: :show
|
||||
prepend_before_action :load_object, only: [:show, :edit, :update]
|
||||
prepend_before_action :authorize_actions, only: :new
|
||||
|
||||
include Spree::Core::ControllerHelpers
|
||||
include I18nHelper
|
||||
|
||||
before_filter :set_locale
|
||||
before_filter :enable_embedded_shopfront
|
||||
before_action :set_locale
|
||||
before_action :enable_embedded_shopfront
|
||||
|
||||
# Ignores invoice orders, only order where state: 'complete'
|
||||
def show
|
||||
@@ -39,7 +39,7 @@ module Spree
|
||||
end
|
||||
|
||||
def update
|
||||
if @user.update_attributes(user_params)
|
||||
if @user.update(user_params)
|
||||
if params[:user][:password].present?
|
||||
# this logic needed b/c devise wants to log us out after password changes
|
||||
Spree::User.reset_password_by_token(params[:user])
|
||||
|
||||
@@ -3,7 +3,7 @@ require 'stripe/webhook_handler'
|
||||
module Stripe
|
||||
class WebhooksController < BaseController
|
||||
protect_from_forgery except: :create
|
||||
before_filter :verify_webhook
|
||||
before_action :verify_webhook
|
||||
|
||||
# POST /stripe/webhooks
|
||||
def create
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class UserPasswordsController < Spree::UserPasswordsController
|
||||
layout 'darkswarm'
|
||||
|
||||
before_filter :set_admin_redirect, only: :edit
|
||||
before_action :set_admin_redirect, only: :edit
|
||||
|
||||
def create
|
||||
render_unconfirmed_response && return if user_unconfirmed?
|
||||
|
||||
@@ -3,10 +3,10 @@ require 'open_food_network/error_logger'
|
||||
class UserRegistrationsController < Spree::UserRegistrationsController
|
||||
I18N_SCOPE = 'devise.user_registrations.spree_user'.freeze
|
||||
|
||||
before_filter :set_checkout_redirect, only: :create
|
||||
before_action :set_checkout_redirect, only: :create
|
||||
|
||||
include I18nHelper
|
||||
before_filter :set_locale
|
||||
before_action :set_locale
|
||||
|
||||
# POST /resource/sign_up
|
||||
def create
|
||||
|
||||
@@ -18,6 +18,10 @@ module AngularFormHelper
|
||||
end
|
||||
end
|
||||
|
||||
class ActionView::Helpers::InstanceTag
|
||||
include AngularFormHelper
|
||||
module ActionView
|
||||
module Helpers
|
||||
class InstanceTag
|
||||
include AngularFormHelper
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,13 +2,13 @@ module I18nHelper
|
||||
def set_locale
|
||||
# Save a given locale
|
||||
if params[:locale] && available_locale?(params[:locale])
|
||||
spree_current_user.update_attributes!(locale: params[:locale]) if spree_current_user
|
||||
spree_current_user&.update!(locale: params[:locale])
|
||||
cookies[:locale] = params[:locale]
|
||||
end
|
||||
|
||||
# After logging in, check if the user chose a locale before
|
||||
if spree_current_user && spree_current_user.locale.nil? && cookies[:locale]
|
||||
spree_current_user.update_attributes!(locale: params[:locale])
|
||||
spree_current_user.update!(locale: params[:locale])
|
||||
end
|
||||
|
||||
I18n.locale = spree_current_user.andand.locale || cookies[:locale] || I18n.default_locale
|
||||
|
||||
@@ -2,13 +2,13 @@ module Spree
|
||||
module BaseHelper
|
||||
# human readable list of variant options
|
||||
# Override: Do not show out of stock text
|
||||
def variant_options(v, _options = {})
|
||||
v.options_text
|
||||
def variant_options(variant, _options = {})
|
||||
variant.options_text
|
||||
end
|
||||
|
||||
# Overriden to eager-load :states
|
||||
def available_countries
|
||||
checkout_zone = Zone.find_by_name(Spree::Config[:checkout_zone])
|
||||
checkout_zone = Zone.find_by(name: Spree::Config[:checkout_zone])
|
||||
|
||||
countries = if checkout_zone && checkout_zone.kind == 'country'
|
||||
checkout_zone.country_list
|
||||
|
||||
@@ -54,7 +54,7 @@ class SubscriptionPlacementJob
|
||||
end
|
||||
unavailable_stock_lines_for(order).each do |line_item|
|
||||
changes[line_item.id] = changes[line_item.id] || line_item.quantity
|
||||
line_item.update_attributes(quantity: 0)
|
||||
line_item.update(quantity: 0)
|
||||
end
|
||||
changes
|
||||
end
|
||||
|
||||
@@ -19,11 +19,14 @@ class ModelSet
|
||||
def collection_attributes=(collection_attributes)
|
||||
collection_attributes.each do |_k, attributes|
|
||||
# attributes == {:id => 123, :next_collection_at => '...'}
|
||||
e = @collection.detect { |e| e.id.to_s == attributes[:id].to_s && !e.id.nil? }
|
||||
if e.nil?
|
||||
found_element = @collection.detect do |element|
|
||||
element.id.to_s == attributes[:id].to_s && !element.id.nil?
|
||||
end
|
||||
|
||||
if found_element.nil?
|
||||
@collection << @klass.new(attributes) unless @reject_if.andand.call(attributes)
|
||||
else
|
||||
e.assign_attributes(attributes.except(:id))
|
||||
found_element.assign_attributes(attributes.except(:id))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ class ProducerProperty < ActiveRecord::Base
|
||||
default_scope { order("#{table_name}.position") }
|
||||
|
||||
def property_name
|
||||
property.name if property
|
||||
property&.name
|
||||
end
|
||||
|
||||
def property_name=(name)
|
||||
|
||||
@@ -46,7 +46,10 @@ module ProductImport
|
||||
else
|
||||
category_validation(entry)
|
||||
tax_and_shipping_validation(entry, 'tax', entry.tax_category, @spreadsheet_data.tax_index)
|
||||
tax_and_shipping_validation(entry, 'shipping', entry.shipping_category, @spreadsheet_data.shipping_index)
|
||||
tax_and_shipping_validation(entry,
|
||||
'shipping',
|
||||
entry.shipping_category,
|
||||
@spreadsheet_data.shipping_index)
|
||||
shipping_presence_validation(entry)
|
||||
product_validation(entry)
|
||||
end
|
||||
@@ -68,8 +71,12 @@ module ProductImport
|
||||
'variant_unit_scale', 'primary_taxon_id')
|
||||
)
|
||||
new_variant.save
|
||||
new_variant.on_demand = entry.attributes['on_demand'] if entry.attributes['on_demand'].present?
|
||||
new_variant.on_hand = entry.attributes['on_hand'] if entry.attributes['on_hand'].present?
|
||||
if entry.attributes['on_demand'].present?
|
||||
new_variant.on_demand = entry.attributes['on_demand']
|
||||
end
|
||||
if entry.attributes['on_hand'].present?
|
||||
new_variant.on_hand = entry.attributes['on_hand']
|
||||
end
|
||||
|
||||
new_variant.product_id = product_id
|
||||
check_on_hand_nil(entry, new_variant)
|
||||
@@ -154,21 +161,28 @@ module ProductImport
|
||||
def unit_fields_validation(entry)
|
||||
unit_types = ['g', 'kg', 't', 'ml', 'l', 'kl', '']
|
||||
|
||||
unless entry.units && entry.units.present?
|
||||
mark_as_invalid(entry, attribute: 'units', error: I18n.t('admin.product_import.model.blank'))
|
||||
unless entry.units&.present?
|
||||
mark_as_invalid(entry, attribute: 'units',
|
||||
error: I18n.t('admin.product_import.model.blank'))
|
||||
end
|
||||
|
||||
return if import_into_inventory?
|
||||
|
||||
# unit_type must be valid type
|
||||
if entry.unit_type && entry.unit_type.present?
|
||||
if entry.unit_type&.present?
|
||||
unit_type = entry.unit_type.to_s.strip.downcase
|
||||
mark_as_invalid(entry, attribute: 'unit_type', error: I18n.t('admin.product_import.model.incorrect_value')) unless unit_types.include?(unit_type)
|
||||
unless unit_types.include?(unit_type)
|
||||
mark_as_invalid(entry, attribute: 'unit_type',
|
||||
error: I18n.t('admin.product_import.model.incorrect_value'))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
# variant_unit_name must be present if unit_type not present
|
||||
mark_as_invalid(entry, attribute: 'variant_unit_name', error: I18n.t('admin.product_import.model.conditional_blank')) unless entry.variant_unit_name && entry.variant_unit_name.present?
|
||||
return if entry.variant_unit_name&.present?
|
||||
|
||||
mark_as_invalid(entry, attribute: 'variant_unit_name',
|
||||
error: I18n.t('admin.product_import.model.conditional_blank'))
|
||||
end
|
||||
|
||||
def variant_of_product_validation(entry)
|
||||
@@ -200,12 +214,15 @@ module ProductImport
|
||||
producer_name = entry.producer
|
||||
|
||||
if producer_name.blank?
|
||||
mark_as_invalid(entry, attribute: "producer", error: I18n.t('admin.product_import.model.blank'))
|
||||
mark_as_invalid(entry, attribute: "producer",
|
||||
error: I18n.t('admin.product_import.model.blank'))
|
||||
return
|
||||
end
|
||||
|
||||
unless @spreadsheet_data.producers_index[producer_name]
|
||||
mark_as_invalid(entry, attribute: "producer", error: "\"#{producer_name}\" #{I18n.t('admin.product_import.model.not_found')}")
|
||||
model_not_found = I18n.t('admin.product_import.model.not_found')
|
||||
mark_as_invalid(entry, attribute: "producer",
|
||||
error: "\"#{producer_name}\" #{model_not_found}")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -214,7 +231,9 @@ module ProductImport
|
||||
@spreadsheet_data.producers_index[producer_name]
|
||||
)
|
||||
|
||||
mark_as_invalid(entry, attribute: "producer", error: "\"#{producer_name}\": #{I18n.t('admin.product_import.model.inventory_no_permission')}")
|
||||
inventory_no_permission = I18n.t('admin.product_import.model.inventory_no_permission')
|
||||
mark_as_invalid(entry, attribute: "producer",
|
||||
error: "\"#{producer_name}\": #{inventory_no_permission}")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -222,10 +241,13 @@ module ProductImport
|
||||
end
|
||||
|
||||
def inventory_validation(entry)
|
||||
products = Spree::Product.where(supplier_id: entry.producer_id, name: entry.name, deleted_at: nil)
|
||||
products = Spree::Product.where(supplier_id: entry.producer_id,
|
||||
name: entry.name,
|
||||
deleted_at: nil)
|
||||
|
||||
if products.empty?
|
||||
mark_as_invalid(entry, attribute: 'name', error: I18n.t('admin.product_import.model.no_product'))
|
||||
mark_as_invalid(entry, attribute: 'name',
|
||||
error: I18n.t('admin.product_import.model.no_product'))
|
||||
return
|
||||
end
|
||||
|
||||
@@ -240,11 +262,13 @@ module ProductImport
|
||||
end
|
||||
end
|
||||
|
||||
mark_as_invalid(entry, attribute: 'product', error: I18n.t('admin.product_import.model.not_found'))
|
||||
mark_as_invalid(entry, attribute: 'product',
|
||||
error: I18n.t('admin.product_import.model.not_found'))
|
||||
end
|
||||
|
||||
def entry_matches_existing_variant?(entry, existing_variant)
|
||||
existing_variant.display_name == entry.display_name && existing_variant.unit_value == entry.unit_value.to_f
|
||||
existing_variant.display_name == entry.display_name &&
|
||||
existing_variant.unit_value == entry.unit_value.to_f
|
||||
end
|
||||
|
||||
def category_validation(entry)
|
||||
@@ -258,7 +282,9 @@ module ProductImport
|
||||
if @spreadsheet_data.categories_index[category_name]
|
||||
entry.primary_taxon_id = @spreadsheet_data.categories_index[category_name]
|
||||
else
|
||||
mark_as_invalid(entry, attribute: "category", error: I18n.t(:error_not_found_in_database, name: category_name))
|
||||
mark_as_invalid(entry, attribute: "category",
|
||||
error: I18n.t(:error_not_found_in_database,
|
||||
name: category_name))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -268,12 +294,16 @@ module ProductImport
|
||||
if index.key? category
|
||||
entry.public_send("#{type}_category_id=", index[category])
|
||||
else
|
||||
mark_as_invalid(entry, attribute: "#{type}_category", error: I18n.t('admin.product_import.model.not_found'))
|
||||
mark_as_invalid(entry, attribute: "#{type}_category",
|
||||
error: I18n.t('admin.product_import.model.not_found'))
|
||||
end
|
||||
end
|
||||
|
||||
def shipping_presence_validation(entry)
|
||||
mark_as_invalid(entry, attribute: "shipping_category", error: I18n.t(:error_required)) unless entry.shipping_category_id
|
||||
return if entry.shipping_category_id
|
||||
|
||||
mark_as_invalid(entry, attribute: "shipping_category",
|
||||
error: I18n.t(:error_required))
|
||||
end
|
||||
|
||||
def product_validation(entry)
|
||||
@@ -289,7 +319,8 @@ module ProductImport
|
||||
products.each { |product| product_field_errors(entry, product) }
|
||||
|
||||
products.flat_map(&:variants).each do |existing_variant|
|
||||
if entry_matches_existing_variant?(entry, existing_variant) && existing_variant.deleted_at.nil?
|
||||
if entry_matches_existing_variant?(entry, existing_variant) &&
|
||||
existing_variant.deleted_at.nil?
|
||||
return mark_as_existing_variant(entry, existing_variant)
|
||||
end
|
||||
end
|
||||
@@ -330,10 +361,12 @@ module ProductImport
|
||||
|
||||
def product_field_errors(entry, existing_product)
|
||||
EntryValidator.non_updatable_fields.each do |display_name, attribute|
|
||||
next if attributes_match?(attribute, existing_product, entry) || attributes_blank?(attribute, existing_product, entry)
|
||||
next if attributes_match?(attribute, existing_product, entry) ||
|
||||
attributes_blank?(attribute, existing_product, entry)
|
||||
next if ignore_when_updating_product?(attribute)
|
||||
|
||||
mark_as_invalid(entry, attribute: display_name, error: I18n.t('admin.product_import.model.not_updatable'))
|
||||
mark_as_invalid(entry, attribute: display_name,
|
||||
error: I18n.t('admin.product_import.model.not_updatable'))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -372,12 +405,14 @@ module ProductImport
|
||||
|
||||
def inventory_permission?(enterprise_id, producer_id)
|
||||
@current_user.admin? ||
|
||||
( @inventory_permissions[enterprise_id] &&
|
||||
@inventory_permissions[enterprise_id].include?(producer_id) )
|
||||
@inventory_permissions[enterprise_id]&.include?(producer_id)
|
||||
end
|
||||
|
||||
def mark_as_invalid(entry, options = {})
|
||||
entry.errors.add(options[:attribute], options[:error]) if options[:attribute] && options[:error]
|
||||
if options[:attribute] && options[:error]
|
||||
entry.errors.add(options[:attribute], options[:error])
|
||||
end
|
||||
|
||||
entry.product_validations = options[:product_validations] if options[:product_validations]
|
||||
end
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# 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
|
||||
# of 100 items, and processed sequentially over a number of requests to avoid server timeouts.
|
||||
# The various bits of collated information such as file upload status, per-item errors or user feedback
|
||||
# The various bits of collated info such as file upload status, per-item errors or user feedback
|
||||
# on the saving process are made available to the controller through this object.
|
||||
|
||||
require 'roo'
|
||||
@@ -59,7 +59,8 @@ module ProductImport
|
||||
|
||||
def product_field_errors?
|
||||
@entries.each do |entry|
|
||||
return true if entry.errors.messages.value?([I18n.t('admin.product_import.model.not_updatable')])
|
||||
return true if entry.errors.messages.
|
||||
value?([I18n.t('admin.product_import.model.not_updatable')])
|
||||
end
|
||||
false
|
||||
end
|
||||
@@ -190,7 +191,7 @@ module ProductImport
|
||||
end
|
||||
|
||||
def staged_import?
|
||||
@import_settings && @import_settings.key?(:start) && @import_settings.key?(:end)
|
||||
@import_settings&.key?(:start) && @import_settings&.key?(:end)
|
||||
end
|
||||
|
||||
def init_permissions
|
||||
@@ -224,7 +225,7 @@ module ProductImport
|
||||
end
|
||||
|
||||
def rows
|
||||
return [] unless @sheet && @sheet.last_row
|
||||
return [] unless @sheet&.last_row
|
||||
|
||||
(2..@sheet.last_row).map do |i|
|
||||
@sheet.row(i)
|
||||
|
||||
@@ -33,7 +33,7 @@ class ProxyOrder < ActiveRecord::Base
|
||||
|
||||
transaction do
|
||||
update_column(:canceled_at, Time.zone.now)
|
||||
order.cancel if order
|
||||
order&.cancel
|
||||
true
|
||||
end
|
||||
end
|
||||
@@ -43,7 +43,7 @@ class ProxyOrder < ActiveRecord::Base
|
||||
|
||||
transaction do
|
||||
update_column(:canceled_at, nil)
|
||||
order.resume if order
|
||||
order&.resume
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -32,7 +32,11 @@ module Spree
|
||||
end
|
||||
|
||||
def set_absolute_included_tax!(tax)
|
||||
# This rubocop issue can only be fixed when Adjustment#update! is brought from Spree to OFN
|
||||
# and renamed to something else, then AR's update! can be used instead of update_attributes!
|
||||
# rubocop:disable Rails/ActiveRecordAliases
|
||||
update_attributes! included_tax: tax.round(2)
|
||||
# rubocop:enable Rails/ActiveRecordAliases
|
||||
end
|
||||
|
||||
def display_included_tax
|
||||
|
||||
@@ -27,7 +27,7 @@ module Spree
|
||||
end
|
||||
|
||||
def stripe_account_id
|
||||
StripeAccount.find_by_enterprise_id(preferred_enterprise_id).andand.stripe_user_id
|
||||
StripeAccount.find_by(enterprise_id: preferred_enterprise_id).andand.stripe_user_id
|
||||
end
|
||||
|
||||
# NOTE: the name of this method is determined by Spree::Payment::Processing
|
||||
@@ -110,7 +110,7 @@ module Spree
|
||||
def fetch_payment(creditcard, gateway_options)
|
||||
order_number = gateway_options[:order_id].split('-').first
|
||||
|
||||
Spree::Order.find_by_number(order_number).payments.merge(creditcard.payments).last
|
||||
Spree::Order.find_by(number: order_number).payments.merge(creditcard.payments).last
|
||||
end
|
||||
|
||||
def failed_activemerchant_billing_response(error_message)
|
||||
|
||||
@@ -87,7 +87,7 @@ Spree::LineItem.class_eval do
|
||||
scoper.scope(variant)
|
||||
return if variant.on_demand
|
||||
|
||||
update_attributes!(quantity: variant.on_hand) if quantity > variant.on_hand
|
||||
update!(quantity: variant.on_hand) if quantity > variant.on_hand
|
||||
end
|
||||
|
||||
def has_tax?
|
||||
|
||||
@@ -5,7 +5,7 @@ class Spree::ProductSet < ModelSet
|
||||
|
||||
def save
|
||||
@collection_hash.each_value.all? do |product_attributes|
|
||||
update_attributes(product_attributes)
|
||||
update_product_attributes(product_attributes)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,19 +18,19 @@ class Spree::ProductSet < ModelSet
|
||||
private
|
||||
|
||||
# A separate method of updating products was required due to an issue with
|
||||
# the way Rails' assign_attributes and updates_attributes behave when
|
||||
# the way Rails' assign_attributes and update behave when
|
||||
# delegated attributes of a nested object are updated via the parent object
|
||||
# (ie. price of variants). Updating such attributes by themselves did not
|
||||
# work using:
|
||||
#
|
||||
# product.update_attributes(variants_attributes: [{ id: y, price: xx.x }])
|
||||
# product.update(variants_attributes: [{ id: y, price: xx.x }])
|
||||
#
|
||||
# and so an explicit call to update attributes on each individual variant was
|
||||
# and so an explicit call to update on each individual variant was
|
||||
# required. ie:
|
||||
#
|
||||
# variant.update_attributes( { price: xx.x } )
|
||||
# variant.update( { price: xx.x } )
|
||||
#
|
||||
def update_attributes(attributes)
|
||||
def update_product_attributes(attributes)
|
||||
split_taxon_ids!(attributes)
|
||||
|
||||
product = find_model(@collection, attributes[:id])
|
||||
@@ -99,7 +99,7 @@ class Spree::ProductSet < ModelSet
|
||||
def create_or_update_variant(product, variant_attributes)
|
||||
variant = find_model(product.variants_including_master, variant_attributes[:id])
|
||||
if variant.present?
|
||||
variant.update_attributes(variant_attributes.except(:id))
|
||||
variant.update(variant_attributes.except(:id))
|
||||
else
|
||||
create_variant(product, variant_attributes)
|
||||
end
|
||||
|
||||
@@ -90,9 +90,7 @@ Spree::Variant.class_eval do
|
||||
end
|
||||
|
||||
def self.indexed
|
||||
Hash[
|
||||
scoped.map { |v| [v.id, v] }
|
||||
]
|
||||
scoped.index_by(&:id)
|
||||
end
|
||||
|
||||
def self.active(currency = nil)
|
||||
|
||||
@@ -27,9 +27,7 @@ class VariantOverride < ActiveRecord::Base
|
||||
localize_number :price
|
||||
|
||||
def self.indexed(hub)
|
||||
Hash[
|
||||
for_hubs(hub).preload(:variant).map { |vo| [vo.variant, vo] }
|
||||
]
|
||||
for_hubs(hub).preload(:variant).index_by(&:variant)
|
||||
end
|
||||
|
||||
def stock_overridden?
|
||||
|
||||
@@ -2,7 +2,9 @@ require 'open_food_network/property_merge'
|
||||
|
||||
class Api::EnterpriseSerializer < ActiveModel::Serializer
|
||||
# We reference this here because otherwise the serializer complains about its absence
|
||||
# rubocop:disable Lint/Void
|
||||
Api::IdSerializer
|
||||
# rubocop:enable Lint/Void
|
||||
|
||||
def serializable_hash
|
||||
cached_serializer_hash.merge uncached_serializer_hash
|
||||
|
||||
@@ -127,7 +127,7 @@ class CartService
|
||||
li = line_item_for_variant loaded_variant
|
||||
|
||||
li_added = li.nil? && (variant_data[:quantity].to_i > 0 || variant_data[:max_quantity].to_i > 0)
|
||||
li_quantity_changed = li.present? && li.quantity.to_i != variant_data[:quantity].to_i
|
||||
li_quantity_changed = li.present? && li.quantity.to_i != variant_data[:quantity].to_i
|
||||
li_max_quantity_changed = li.present? && li.max_quantity.to_i != variant_data[:max_quantity].to_i
|
||||
|
||||
li_added || li_quantity_changed || li_max_quantity_changed
|
||||
|
||||
@@ -64,8 +64,8 @@ class LineItemSyncer
|
||||
|
||||
def update_quantity(line_item, sli)
|
||||
if line_item.quantity == sli.quantity_was
|
||||
return line_item.update_attributes(quantity: sli.quantity,
|
||||
skip_stock_check: skip_stock_check?(line_item.order))
|
||||
return line_item.update(quantity: sli.quantity,
|
||||
skip_stock_check: skip_stock_check?(line_item.order))
|
||||
end
|
||||
line_item.quantity == sli.quantity
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Resets the passed order to cart state while clearing associated payments and shipments
|
||||
class OrderCheckoutRestart
|
||||
def initialize(order)
|
||||
|
||||
@@ -66,7 +66,7 @@ class OrderFactory
|
||||
end
|
||||
|
||||
def set_addresses
|
||||
@order.update_attributes(attrs.slice(:bill_address_attributes, :ship_address_attributes))
|
||||
@order.update(attrs.slice(:bill_address_attributes, :ship_address_attributes))
|
||||
end
|
||||
|
||||
def create_shipment
|
||||
|
||||
@@ -49,7 +49,7 @@ class OrderSyncer
|
||||
return order_update_issues.add(order, I18n.t('bill_address'))
|
||||
end
|
||||
|
||||
order.bill_address.update_attributes(bill_address.attributes.slice(*relevant_address_attrs))
|
||||
order.bill_address.update(bill_address.attributes.slice(*relevant_address_attrs))
|
||||
end
|
||||
|
||||
def update_payment_for(order)
|
||||
@@ -123,7 +123,7 @@ class OrderSyncer
|
||||
def save_ship_address_in_order(order)
|
||||
return unless ship_address_updatable?(order)
|
||||
|
||||
order.ship_address.update_attributes(ship_address.attributes.slice(*relevant_address_attrs))
|
||||
order.ship_address.update(ship_address.attributes.slice(*relevant_address_attrs))
|
||||
end
|
||||
|
||||
def pending_shipment_with?(order, shipping_method_id)
|
||||
|
||||
@@ -26,13 +26,13 @@ class UserDefaultAddressSetter
|
||||
private
|
||||
|
||||
def set_bill_address_attributes(object, new_address)
|
||||
object.update_attributes(
|
||||
object.update(
|
||||
bill_address_attributes: new_address.merge('id' => object.bill_address.andand.id)
|
||||
)
|
||||
end
|
||||
|
||||
def set_ship_address_attributes(object, new_address)
|
||||
object.update_attributes(
|
||||
object.update(
|
||||
ship_address_attributes: new_address.merge('id' => object.ship_address.andand.id)
|
||||
)
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
- method.distributors.each do |distributor|
|
||||
= distributor.name
|
||||
%br/
|
||||
%td= method.type
|
||||
%td= method.class.clean_name
|
||||
%td.align-center= method.environment.to_s.titleize
|
||||
%td.align-center= method.display_on.blank? ? t('.both') : t('.' + method.display_on.to_s)
|
||||
%td.align-center= method.active ? t('.active_yes') : t('.active_no')
|
||||
|
||||
@@ -302,6 +302,7 @@ en:
|
||||
on_hand: "On Hand"
|
||||
"on hand": "On Hand"
|
||||
ship: "Ship"
|
||||
shipping_category: "Shipping Category"
|
||||
|
||||
actions:
|
||||
create_and_add_another: "Create and Add Another"
|
||||
@@ -2203,6 +2204,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
hub_sidebar_at_least: "At least one hub must be selected"
|
||||
hub_sidebar_blue: "blue"
|
||||
hub_sidebar_red: "red"
|
||||
order_cycles_closed_for_hub: "The hub you have selected is temporarily closed for orders. Please try again later."
|
||||
report_customers_distributor: "Distributor"
|
||||
report_customers_supplier: "Supplier"
|
||||
report_customers_cycle: "Order Cycle"
|
||||
@@ -2441,6 +2443,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
order_cycles_email_to_producers_notice: 'Emails to be sent to producers have been queued for sending.'
|
||||
order_cycles_no_permission_to_coordinate_error: "None of your enterprises have permission to coordinate an order cycle"
|
||||
order_cycles_no_permission_to_create_error: "You don't have permission to create an order cycle coordinated by that enterprise"
|
||||
order_cycle_closed: "The order cycle you've selected has just closed. Please try again!"
|
||||
back_to_orders_list: "Back to order list"
|
||||
no_orders_found: "No Orders Found"
|
||||
order_information: "Order Information"
|
||||
@@ -2918,6 +2921,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
last: "Last"
|
||||
|
||||
spree:
|
||||
more: "More"
|
||||
your_order_is_empty_add_product: "Your order is empty, please search for and add a product above"
|
||||
add_product: "Add Product"
|
||||
name_or_sku: "Name or SKU (enter at least first 4 characters of product name)"
|
||||
|
||||
@@ -1147,13 +1147,18 @@ en_FR:
|
||||
menu:
|
||||
cart:
|
||||
cart: "Cart"
|
||||
cart_sidebar:
|
||||
checkout: "Checkout"
|
||||
edit_cart: "Edit cart"
|
||||
items_in_cart_singular: "%{num} item in your cart"
|
||||
items_in_cart_plural: "%{num} item in your cart"
|
||||
close: "Close"
|
||||
cart_empty: "Your cart is empty"
|
||||
take_me_shopping: "Take me shopping!"
|
||||
signed_in:
|
||||
profile: "Profile"
|
||||
mobile_menu:
|
||||
cart: "Cart"
|
||||
joyride:
|
||||
checkout: "Checkout now"
|
||||
already_ordered_products: "Already ordered in this order cycle"
|
||||
register_call:
|
||||
selling_on_ofn: "Interested in getting on the Open Food Network?"
|
||||
register: "Register here"
|
||||
|
||||
@@ -33,6 +33,10 @@ en_US:
|
||||
taken: "There's already an account registered for this email. Please login to reset your password."
|
||||
spree/order:
|
||||
no_card: There are no authorized credit cards available to charge
|
||||
spree/credit_card:
|
||||
attributes:
|
||||
base:
|
||||
card_expired: "has expired"
|
||||
order_cycle:
|
||||
attributes:
|
||||
orders_close_at:
|
||||
@@ -321,6 +325,7 @@ en_US:
|
||||
show_n_more: Show %{num} more
|
||||
choose: "Choose..."
|
||||
please_select: Please select...
|
||||
column_save_as_default: Save As Default
|
||||
columns: Columns
|
||||
actions: Actions
|
||||
viewing: "Viewing: %{current_view_name}"
|
||||
@@ -365,7 +370,10 @@ en_US:
|
||||
title: "Matomo Settings"
|
||||
matomo_url: "Matomo URL"
|
||||
matomo_site_id: "Matomo Site ID"
|
||||
matomo_tag_manager_url: "Matomo Tag Manager URL"
|
||||
info_html: "Matomo is a Web and Mobile Analytics application. You can either host Matomo on-premises or use a cloud-hosted service. See <a href='http://matomo.org' target='_blank'>matomo.org</a> for more information."
|
||||
config_instructions_html: "Here you can configure the OFN Matomo integration. The Matomo URL below should point to the Matomo instance where the user tracking information will be sent to; if it is left empty, Matomo user tracking will be disabled. The Site ID field is not mandatory but useful if you are tracking more than one website on a single Matomo instance; it can be found on the Matomo instance console."
|
||||
config_instructions_tag_manager_html: "Setting the Matomo Tag Manager URL enables Matomo Tag Manager. This tool allows you to set up analytics events. The Matomo Tag Manager URL is copied from the Install Code section of Matomo Tag Manager. Ensure you select the right container and environment as these options change the URL."
|
||||
customers:
|
||||
index:
|
||||
new_customer: "New Customer"
|
||||
@@ -471,6 +479,7 @@ en_US:
|
||||
line_number: "Line %{number}:"
|
||||
encoding_error: "Please check the language setting of your source file and ensure it is saved with UTF-8 encoding"
|
||||
unexpected_error: "Product Import encountered an unexpected error when opening the file: %{error_message}"
|
||||
malformed_csv: "Product Import encountered a malformed CSV: %{error_message}"
|
||||
index:
|
||||
notice: "Notice"
|
||||
beta_notice: "This feature is still in beta: you may experience some errors while using it. Please don't hesitate to contact support."
|
||||
@@ -683,6 +692,7 @@ en_US:
|
||||
ofn_uid_tip: The unique id used to identify the enterprise on Open Food Network.
|
||||
shipping_methods:
|
||||
name: "Name"
|
||||
applies: "Active?"
|
||||
manage: "Manage Shipping Methods"
|
||||
create_button: "Create New Shipping Method"
|
||||
create_one_button: "Create One Now"
|
||||
@@ -861,6 +871,7 @@ en_US:
|
||||
incoming: "Incoming"
|
||||
supplier: "Supplier"
|
||||
products: "Products"
|
||||
receival_details: "Receival Details"
|
||||
fees: "Fees"
|
||||
save: "Save"
|
||||
save_and_next: "Save and Next"
|
||||
@@ -1136,13 +1147,18 @@ en_US:
|
||||
menu:
|
||||
cart:
|
||||
cart: "Cart"
|
||||
cart_sidebar:
|
||||
checkout: "Checkout"
|
||||
edit_cart: "Edit cart"
|
||||
items_in_cart_singular: "%{num} item in your cart"
|
||||
items_in_cart_plural: "%{num} items in your cart"
|
||||
close: "Close"
|
||||
cart_empty: "Your cart is empty"
|
||||
take_me_shopping: "Let's go shopping!"
|
||||
signed_in:
|
||||
profile: "Profile"
|
||||
mobile_menu:
|
||||
cart: "Cart"
|
||||
joyride:
|
||||
checkout: "Checkout now"
|
||||
already_ordered_products: "Already ordered in this order cycle"
|
||||
register_call:
|
||||
selling_on_ofn: "Interested in selling through the Open Food Network?"
|
||||
register: "Register here"
|
||||
@@ -1170,7 +1186,11 @@ en_US:
|
||||
signup: "signup"
|
||||
contact: "contact"
|
||||
require_customer_login: "Only approved customers can access this shop."
|
||||
require_login_html: "If you're already an approved customer, %{login} or %{signup} to proceed."
|
||||
require_login_2_html: "Want to start shopping here? Please %{contact} %{enterprise} and ask about joining."
|
||||
require_customer_html: "If you'd like to start shopping here, please %{contact} %{enterprise} to ask about joining."
|
||||
select_oc:
|
||||
select_oc_html: "Please <span class='highlighted'>choose when you want your order</span>, to see what products are available."
|
||||
card_could_not_be_updated: Card could not be updated
|
||||
card_could_not_be_saved: card could not be saved
|
||||
spree_gateway_error_flash_for_checkout: "There was a problem with your payment information: %{error}"
|
||||
@@ -1530,12 +1550,17 @@ en_US:
|
||||
orders_changeable_orders_alert_html: This order has been confirmed, but you can make changes until <strong>%{oc_close}</strong>.
|
||||
products_clear: Clear
|
||||
products_showing: "Showing:"
|
||||
products_results_for: "Results for"
|
||||
products_or: "or"
|
||||
products_and: "and"
|
||||
products_filters_in: "in"
|
||||
products_with: with
|
||||
products_search: "Search..."
|
||||
products_filter_by: "Filter by"
|
||||
products_filter_selected: "selected"
|
||||
products_filter_heading: "Filters"
|
||||
products_filter_clear: "Clear"
|
||||
products_filter_done: "Done"
|
||||
products_loading: "Loading products..."
|
||||
products_updating_cart: "Updating cart..."
|
||||
products_cart_empty: "Cart empty"
|
||||
@@ -1546,6 +1571,8 @@ en_US:
|
||||
products_update_error_msg: "Saving failed."
|
||||
products_update_error_data: "Save failed due to invalid data:"
|
||||
products_changes_saved: "Changes saved."
|
||||
products_no_results_html: "Sorry, no results found for %{query}"
|
||||
products_clear_search: "Clear search"
|
||||
search_no_results_html: "Sorry, no results found for %{query}. Try another search?"
|
||||
components_profiles_popover: "Profiles do not have a shopfront on the Open Food Network, but may have their own physical or online shop elsewhere"
|
||||
components_profiles_show: "Show profiles"
|
||||
@@ -1901,6 +1928,7 @@ en_US:
|
||||
admin_enterprise_relationships_permits: "permits"
|
||||
admin_enterprise_relationships_seach_placeholder: "Search"
|
||||
admin_enterprise_relationships_button_create: "Create"
|
||||
admin_enterprise_relationships_to: "to"
|
||||
admin_enterprise_groups: "Enterprise Groups"
|
||||
admin_enterprise_groups_name: "Name"
|
||||
admin_enterprise_groups_owner: "Owner"
|
||||
@@ -2306,6 +2334,10 @@ en_US:
|
||||
resolve_errors: Please resolve the following errors
|
||||
more_items: "+ %{count} More"
|
||||
default_card_updated: Default Card Updated
|
||||
cart:
|
||||
add_to_cart_failed: >
|
||||
There was a problem adding this product to the cart. Perhaps it has become
|
||||
unavailable or the shop is closing.
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
@@ -2621,6 +2653,9 @@ en_US:
|
||||
tub:
|
||||
one: "tub"
|
||||
other: "tubs"
|
||||
punnet:
|
||||
one: "baskets"
|
||||
other: "baskets"
|
||||
packet:
|
||||
one: "packet"
|
||||
other: "packets"
|
||||
@@ -2785,6 +2820,12 @@ en_US:
|
||||
void: "Void"
|
||||
login: "Login"
|
||||
password: "Password"
|
||||
signature: "Signature"
|
||||
solution: "Solution"
|
||||
landing_page: "Landing Page"
|
||||
server: "Server"
|
||||
test_mode: "Test Mode"
|
||||
logourl: "Logourl"
|
||||
configurations: "Configurations"
|
||||
general_settings: "General Settings"
|
||||
site_name: "Site Name"
|
||||
@@ -2901,6 +2942,12 @@ en_US:
|
||||
options: "Options"
|
||||
actions:
|
||||
update: "Update"
|
||||
shared:
|
||||
error_messages:
|
||||
errors_prohibited_this_record_from_being_saved:
|
||||
one: "1 error prohibited this record from being saved:"
|
||||
other: "%{count} errors prohibited this record from being saved:"
|
||||
there_were_problems_with_the_following_fields: "There were problems with the following fields"
|
||||
errors:
|
||||
messages:
|
||||
blank: "can't be blank"
|
||||
@@ -3043,6 +3090,8 @@ en_US:
|
||||
zone: "Zone"
|
||||
calculator: "Calculator"
|
||||
display: "Display"
|
||||
both: "Both Checkout and Back office"
|
||||
back_end: "Back office only"
|
||||
no_shipping_methods_found: "No shipping methods found"
|
||||
new:
|
||||
new_shipping_method: "New Shipping Method"
|
||||
@@ -3054,6 +3103,9 @@ en_US:
|
||||
form:
|
||||
categories: "Categories"
|
||||
zones: "Zones"
|
||||
both: "Both Checkout and Back office"
|
||||
back_end: "Back office only"
|
||||
deactivation_warning: "De-activating a shipping method can make the shipping method disappear from your list. Alternatively, you can hide a shipping method from the checkout page by setting the option 'Display' to 'back office only'."
|
||||
payment_methods:
|
||||
index:
|
||||
payment_methods: "Payment Methods"
|
||||
@@ -3065,8 +3117,11 @@ en_US:
|
||||
display: "Display"
|
||||
active: "Active"
|
||||
both: "Both"
|
||||
front_end: "Checkout only"
|
||||
back_end: "Back office only"
|
||||
active_yes: "Yes"
|
||||
active_no: "No"
|
||||
no_payment_methods_found: "No payment methods found"
|
||||
new:
|
||||
new_payment_method: "New Payment Method"
|
||||
back_to_payment_methods_list: "Back To Payment Methods List"
|
||||
@@ -3095,7 +3150,11 @@ en_US:
|
||||
active: "Active"
|
||||
active_yes: "Yes"
|
||||
active_no: "No"
|
||||
both: "Both Checkout and Back office"
|
||||
front_end: "Checkout only"
|
||||
back_end: "Back office only"
|
||||
tags: "Tags"
|
||||
deactivation_warning: "De-activating a payment method can make the payment method disappear from your list. Alternatively, you can hide a payment method from the checkout page by setting the option 'Display' to 'back office only'."
|
||||
providers:
|
||||
provider: "Provider"
|
||||
payments:
|
||||
@@ -3192,10 +3251,13 @@ en_US:
|
||||
new:
|
||||
new_variant: "New Variant"
|
||||
form:
|
||||
cost_price: "Cost Price"
|
||||
sku: "SKU"
|
||||
price: "Price"
|
||||
display_as: "Display As"
|
||||
display_name: "Display Name"
|
||||
display_as_placeholder: 'For example, 2 kg'
|
||||
display_name_placeholder: 'For example, Tomatoes'
|
||||
autocomplete:
|
||||
out_of_stock: "Out of Stock"
|
||||
producer_name: "Producer"
|
||||
@@ -3235,6 +3297,7 @@ en_US:
|
||||
format: '%Y-%m-%d'
|
||||
js_format: 'yy-mm-dd'
|
||||
orders:
|
||||
error_flash_for_unavailable_items: "An item in your cart has become unavailable. Please update the selected quantities."
|
||||
edit:
|
||||
login_to_view_order: "Please log in to view your order."
|
||||
bought:
|
||||
@@ -3262,6 +3325,14 @@ en_US:
|
||||
invalid: Invalid
|
||||
order_mailer:
|
||||
cancel_email:
|
||||
customer_greeting: "Dear %{name},"
|
||||
instructions_html: "Your order with <strong>%{distributor}</strong> has been CANCELED. Please retain this cancellation information for your records."
|
||||
dont_cancel: "If you have changed your mind or don't wish to cancel this order please contact %{email}"
|
||||
order_summary_canceled_html: "<strong>Order Summary #%{number} [CANCELED]</strong>"
|
||||
details: "Here are the details of what you ordered:"
|
||||
unpaid_order: "Your order was unpaid so no refund has been made"
|
||||
paid_order: "Your order was paid so %{distributor} has refunded the full amount"
|
||||
credit_order: "Your order was paid so your account has been credited"
|
||||
subject: "Cancellation of Order"
|
||||
confirm_email:
|
||||
subject: "Order Confirmation"
|
||||
|
||||
@@ -1149,13 +1149,18 @@ fr:
|
||||
menu:
|
||||
cart:
|
||||
cart: "Panier"
|
||||
cart_sidebar:
|
||||
checkout: "Etape suivante (coordonnées)"
|
||||
edit_cart: "Modifier le panier"
|
||||
items_in_cart_singular: "%{num} élément dans le panier"
|
||||
items_in_cart_plural: "%{num} éléments dans le panier"
|
||||
close: "Fermer"
|
||||
cart_empty: "Le panier est vide"
|
||||
take_me_shopping: "Continuer mes achats"
|
||||
signed_in:
|
||||
profile: "Profil"
|
||||
mobile_menu:
|
||||
cart: "Panier"
|
||||
joyride:
|
||||
checkout: "Poursuivre la commande"
|
||||
already_ordered_products: "Déjà commandé dans ce cycle de vente"
|
||||
register_call:
|
||||
selling_on_ofn: "Vous souhaitez proposer vos produits sur Open Food France?"
|
||||
register: "Démarrez ici"
|
||||
|
||||
@@ -370,7 +370,10 @@ tr:
|
||||
title: "Matomo Ayarları"
|
||||
matomo_url: "Matomo URL'si"
|
||||
matomo_site_id: "Matomo Site Kimliği"
|
||||
matomo_tag_manager_url: "Matomo Tag Manager URL"
|
||||
info_html: "Matomo, Web ve Mobil Analitik uygulamasıdır. Daha fazla bilgi için <a href='http://matomo.org' target='_blank'>matomo.org</a> sitesini ziyaret edin."
|
||||
config_instructions_html: "Burada OFN Matomo entegrasyonunu yapılandırabilirsiniz. Aşağıdaki Matomo URL'si, kullanıcı izleme bilgilerinin gönderileceği Matomo örneğini göstermelidir; boş bırakılırsa Matomo kullanıcı takibi devre dışı bırakılır. Site Kimliği alanı zorunlu değildir, ancak tek bir Matomo örneğinde birden fazla web sitesini izliyorsanız yararlıdır; Matomo örnek konsolunda bulunabilir."
|
||||
config_instructions_tag_manager_html: "Setting the Matomo Tag Manager URL enables Matomo Tag Manager. This tool allows you to set up analytics events. The Matomo Tag Manager URL is copied from the Install Code section of Matomo Tag Manager. Ensure you select the right container and environment as these options change the URL."
|
||||
customers:
|
||||
index:
|
||||
new_customer: "Yeni Müşteri"
|
||||
@@ -476,6 +479,7 @@ tr:
|
||||
line_number: "%{number}. satır:"
|
||||
encoding_error: "Lütfen kaynak dosyanızın dil ayarını kontrol edin ve UTF-8 kodlamasıyla kaydedildiğinden emin olun"
|
||||
unexpected_error: "Ürün içe aktarımında dosyayı açarken beklenmeyen bir hatayla karşılaşıldı: %{error_message}"
|
||||
malformed_csv: "Ürün içe aktarımında CSV biçim hatası ile karşılaşıldı: %{error_message}"
|
||||
index:
|
||||
notice: "Dikkat"
|
||||
beta_notice: "Bu özellik hala beta sürümündedir: kullanırken bazı hatalarla karşılaşabilirsiniz. Lütfen teknik destek için iletişime geçmekten çekinmeyin."
|
||||
@@ -2939,7 +2943,7 @@ tr:
|
||||
errors_prohibited_this_record_from_being_saved:
|
||||
one: "1 hata kaydedilmesini engelledi:"
|
||||
other: "%{count}hata kaydedilmeyi engelledi:"
|
||||
there_were_problems_with_the_following_fields: "Gösterilen alanlar ile ilgili sorun oluştu:"
|
||||
there_were_problems_with_the_following_fields: "Belirtilen alanlar ile ilgili sorun oluştu:"
|
||||
errors:
|
||||
messages:
|
||||
blank: "boş olamaz"
|
||||
@@ -3251,7 +3255,7 @@ tr:
|
||||
display_as_placeholder: 'örn. 2 kg'
|
||||
display_name_placeholder: 'örn. Domates'
|
||||
autocomplete:
|
||||
out_of_stock: "Stok tükendi"
|
||||
out_of_stock: "Tükendi"
|
||||
producer_name: "Üretici"
|
||||
unit: "Birim"
|
||||
shared:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user