From 06b28c1ab46ef94f3b07e6eca12111696ca336ba Mon Sep 17 00:00:00 2001 From: Aditya Sridhar Date: Sun, 30 Sep 2018 15:50:33 -0400 Subject: [PATCH 01/23] Better docs for Stripe.publishable_key and Stripe.endpoint_secret. --- config/initializers/stripe.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/initializers/stripe.rb b/config/initializers/stripe.rb index 8237b0dcab..80a715b81f 100644 --- a/config/initializers/stripe.rb +++ b/config/initializers/stripe.rb @@ -4,6 +4,8 @@ # a bit cleaner than accessing keys in different ways. module Stripe class << self + # Returns the value of Stripe.publishable_key and Stripe.endpoint_secret. + # Attribute values can also be set by doing Stripe.publishable_key = attr_accessor :publishable_key, :endpoint_secret end end From 372ae8e4aab5d2a6f20fd7fa2c324aab33906e5b Mon Sep 17 00:00:00 2001 From: Aditya Sridhar Date: Sun, 30 Sep 2018 16:10:57 -0400 Subject: [PATCH 02/23] updated the spacing to be consistent. --- config/initializers/stripe.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/stripe.rb b/config/initializers/stripe.rb index 80a715b81f..d4dc8950e0 100644 --- a/config/initializers/stripe.rb +++ b/config/initializers/stripe.rb @@ -4,8 +4,8 @@ # a bit cleaner than accessing keys in different ways. module Stripe class << self - # Returns the value of Stripe.publishable_key and Stripe.endpoint_secret. - # Attribute values can also be set by doing Stripe.publishable_key = + # Returns the value of Stripe.publishable_key and Stripe.endpoint_secret. + # Attribute values can also be set by doing Stripe.publishable_key = attr_accessor :publishable_key, :endpoint_secret end end From 3ae38178a3e55e141d326b386ed7a820cf1b283b Mon Sep 17 00:00:00 2001 From: niko Date: Thu, 4 Oct 2018 02:43:02 +0200 Subject: [PATCH 03/23] Move query from variant_overrides_controller to its model scope --- .../admin/variant_overrides_controller.rb | 6 +----- app/models/variant_override.rb | 8 ++++++-- spec/models/variant_override_spec.rb | 18 ++++++++++++------ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/app/controllers/admin/variant_overrides_controller.rb b/app/controllers/admin/variant_overrides_controller.rb index 4a49f53c7c..a8701a2911 100644 --- a/app/controllers/admin/variant_overrides_controller.rb +++ b/app/controllers/admin/variant_overrides_controller.rb @@ -60,11 +60,7 @@ module Admin end def inventory_import_dates - import_dates = VariantOverride. - select('DISTINCT variant_overrides.import_date'). - where('variant_overrides.hub_id IN (?) - AND variant_overrides.import_date IS NOT NULL', editable_enterprises.collect(&:id)). - order('import_date DESC') + import_dates = VariantOverride.distinct_import_dates.for_hubs(editable_enterprises.collect(&:id)) options = [{ id: '0', name: 'All' }] import_dates.collect(&:import_date).map { |i| options.push(id: i.to_date, name: i.to_date.to_formatted_s(:long)) } diff --git a/app/models/variant_override.rb b/app/models/variant_override.rb index a6a5dfe8ed..89d2fdcd13 100644 --- a/app/models/variant_override.rb +++ b/app/models/variant_override.rb @@ -3,8 +3,6 @@ class VariantOverride < ActiveRecord::Base acts_as_taggable - attr_accessor :import_date - belongs_to :hub, class_name: 'Enterprise' belongs_to :variant, class_name: 'Spree::Variant' @@ -21,6 +19,12 @@ class VariantOverride < ActiveRecord::Base where(hub_id: hubs) } + scope :distinct_import_dates, lambda { + select('DISTINCT variant_overrides.import_date'). + where('variant_overrides.import_date IS NOT NULL'). + order('import_date DESC') + } + localize_number :price def self.indexed(hub) diff --git a/spec/models/variant_override_spec.rb b/spec/models/variant_override_spec.rb index 0a07fdd1af..bb799f8603 100644 --- a/spec/models/variant_override_spec.rb +++ b/spec/models/variant_override_spec.rb @@ -7,10 +7,9 @@ describe VariantOverride do describe "scopes" do let(:hub1) { create(:distributor_enterprise) } let(:hub2) { create(:distributor_enterprise) } - let(:v) { create(:variant) } - let!(:vo1) { create(:variant_override, hub: hub1, variant: v) } - let!(:vo2) { create(:variant_override, hub: hub2, variant: v) } - let!(:vo3) { create(:variant_override, hub: hub1, variant: v, permission_revoked_at: Time.now) } + let!(:vo1) { create(:variant_override, hub: hub1, variant: variant, import_date: Time.zone.now.yesterday) } + let!(:vo2) { create(:variant_override, hub: hub2, variant: variant, import_date: Time.zone.now) } + let!(:vo3) { create(:variant_override, hub: hub1, variant: variant, permission_revoked_at: Time.now) } it "ignores variant_overrides with revoked_permissions by default" do expect(VariantOverride.all).to_not include vo3 @@ -21,10 +20,17 @@ describe VariantOverride do VariantOverride.for_hubs([hub1, hub2]).should match_array [vo1, vo2] end + it "fetches import dates for hubs in descending order" do + import_dates = VariantOverride.distinct_import_dates.pluck :import_date + + expect(import_dates[0].to_i).to eq(vo2.import_date.to_i) + expect(import_dates[1].to_i).to eq(vo1.import_date.to_i) + end + describe "fetching variant overrides indexed by variant" do it "gets indexed variant overrides for one hub" do - VariantOverride.indexed(hub1).should == {v => vo1} - VariantOverride.indexed(hub2).should == {v => vo2} + VariantOverride.indexed(hub1).should == {variant => vo1} + VariantOverride.indexed(hub2).should == {variant => vo2} end end end From f65d3c28158da09a4221a7de33dc85ddd4f4b000 Mon Sep 17 00:00:00 2001 From: niko Date: Thu, 4 Oct 2018 03:30:32 +0200 Subject: [PATCH 04/23] fix rubocop issue --- app/controllers/admin/variant_overrides_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/variant_overrides_controller.rb b/app/controllers/admin/variant_overrides_controller.rb index a8701a2911..f7145e84c7 100644 --- a/app/controllers/admin/variant_overrides_controller.rb +++ b/app/controllers/admin/variant_overrides_controller.rb @@ -60,7 +60,9 @@ module Admin end def inventory_import_dates - import_dates = VariantOverride.distinct_import_dates.for_hubs(editable_enterprises.collect(&:id)) + import_dates = VariantOverride. + distinct_import_dates. + for_hubs(editable_enterprises.collect(&:id)) options = [{ id: '0', name: 'All' }] import_dates.collect(&:import_date).map { |i| options.push(id: i.to_date, name: i.to_date.to_formatted_s(:long)) } From b78716c283099ba4cd34ed129c482be79eef1cd8 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 8 Oct 2018 13:59:33 +0100 Subject: [PATCH 05/23] Fix missing local variable --- app/models/product_import/entry_processor.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/models/product_import/entry_processor.rb b/app/models/product_import/entry_processor.rb index 315721ffbb..7c0ee54575 100644 --- a/app/models/product_import/entry_processor.rb +++ b/app/models/product_import/entry_processor.rb @@ -139,7 +139,8 @@ module ProductImport @inventory_created += 1 @updated_ids.push new_item.id else - @importer.errors.add("#{I18n.t('admin.product_import.model.line')} #{line_number}:", new_item.errors.full_messages) + @importer.errors.add("#{I18n.t('admin.product_import.model.line')} \ + #{entry.line_number}:", new_item.errors.full_messages) end end @@ -153,7 +154,8 @@ module ProductImport @inventory_updated += 1 @updated_ids.push existing_item.id else - @importer.errors.add("#{I18n.t('admin.product_import.model.line')} #{line_number}:", existing_item.errors.full_messages) + @importer.errors.add("#{I18n.t('admin.product_import.model.line')} \ + #{entry.line_number}:", existing_item.errors.full_messages) end end @@ -177,7 +179,8 @@ module ProductImport @products_created += 1 @updated_ids.push product.variants.first.id else - @importer.errors.add("#{I18n.t('admin.product_import.model.line')} #{line_number}:", product.errors.full_messages) + @importer.errors.add("#{I18n.t('admin.product_import.model.line')} \ + #{entry.line_number}:", product.errors.full_messages) end @already_created[entry.supplier_id] = { entry.name => product.id } @@ -192,7 +195,8 @@ module ProductImport @updated_ids.push variant.id true else - @importer.errors.add("#{I18n.t('admin.product_import.model.line')} #{line_number}:", variant.errors.full_messages) + @importer.errors.add("#{I18n.t('admin.product_import.model.line')} \ + #{entry.line_number}:", variant.errors.full_messages) false end end From 3e39f3e7499e4b3c3c9ad9d8ae7204c8159a2c7c Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 8 Oct 2018 23:06:54 +0100 Subject: [PATCH 06/23] Disable logout on password change --- config/initializers/spree.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb index 9b62e3ad6e..e63d21bde9 100644 --- a/config/initializers/spree.rb +++ b/config/initializers/spree.rb @@ -22,6 +22,9 @@ Spree.config do |config| #config.override_actionmailer_config = false end +# Don't log users out when setting a new password +Spree::Auth::Config[:signout_after_password_change] = false + # TODO Work out why this is necessary # Seems like classes within OFN module become 'uninitialized' when server reloads # unless the empty module is explicity 'registered' here. Something to do with autoloading? From 55411af3fa09db906a3723bac36977a03f78b9b9 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 8 Oct 2018 23:55:28 +0100 Subject: [PATCH 07/23] Improve user account spec --- .../consumer/account/settings_spec.rb | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/spec/features/consumer/account/settings_spec.rb b/spec/features/consumer/account/settings_spec.rb index 383d03a4be..e9001f177c 100644 --- a/spec/features/consumer/account/settings_spec.rb +++ b/spec/features/consumer/account/settings_spec.rb @@ -4,18 +4,22 @@ feature "Account Settings", js: true do include AuthenticationWorkflow describe "as a logged in user" do - let(:user) { create(:user, email: 'old@email.com') } + let(:user) do + create(:user, + email: 'old@email.com', + password: 'OriginalPassword', + password_confirmation: 'OriginalPassword') + end before do create(:mail_method) quick_login_as user - end - - it "allows me to update my account details" do visit "/account" - click_link I18n.t('spree.users.show.tabs.settings') expect(page).to have_content I18n.t('spree.users.form.account_settings') + end + + it "allows the user to update their email address" do fill_in 'user_email', with: 'new@email.com' click_button I18n.t(:update) @@ -27,5 +31,18 @@ feature "Account Settings", js: true do click_link I18n.t('spree.users.show.tabs.settings') expect(page).to have_content I18n.t('spree.users.show.unconfirmed_email', unconfirmed_email: 'new@email.com') end + + it "allows the user to change their password" do + allow(Spree::Auth::Config).to receive(:[]).with(:signout_after_password_change).and_return(false) + initial_password = user.encrypted_password + + fill_in 'user_password', with: 'NewPassword' + fill_in 'user_password_confirmation', with: 'NewPassword' + + click_button I18n.t(:update) + expect(find(".alert-box.success").text.strip).to eq "#{I18n.t(:account_updated)} ×" + + expect(user.reload.encrypted_password).to_not eq initial_password + end end end From 4760ebb80c908b70a9fd5a0d184a57a49d2b36b3 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 11 Oct 2018 09:04:37 +0100 Subject: [PATCH 08/23] Use global config --- spec/features/consumer/account/settings_spec.rb | 1 - spec/spec_helper.rb | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/consumer/account/settings_spec.rb b/spec/features/consumer/account/settings_spec.rb index e9001f177c..32dc8d3534 100644 --- a/spec/features/consumer/account/settings_spec.rb +++ b/spec/features/consumer/account/settings_spec.rb @@ -33,7 +33,6 @@ feature "Account Settings", js: true do end it "allows the user to change their password" do - allow(Spree::Auth::Config).to receive(:[]).with(:signout_after_password_change).and_return(false) initial_password = user.encrypted_password fill_in 'user_password', with: 'NewPassword' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 328c2aaac3..6b73d23fb0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -120,6 +120,7 @@ RSpec.configure do |config| spree_config.allow_backorders = false end + Spree::Auth::Config[:signout_after_password_change] = false Spree::Api::Config[:requires_authentication] = true end From 57c6530e4658437b7143f4793e28819684e026c3 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 11 Oct 2018 16:04:45 +0100 Subject: [PATCH 09/23] DRY code and use more flexible I18n --- app/models/product_import/entry_processor.rb | 20 ++++++++++++-------- config/locales/en.yml | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/models/product_import/entry_processor.rb b/app/models/product_import/entry_processor.rb index 7c0ee54575..7766d7b8e0 100644 --- a/app/models/product_import/entry_processor.rb +++ b/app/models/product_import/entry_processor.rb @@ -139,8 +139,7 @@ module ProductImport @inventory_created += 1 @updated_ids.push new_item.id else - @importer.errors.add("#{I18n.t('admin.product_import.model.line')} \ - #{entry.line_number}:", new_item.errors.full_messages) + assign_errors new_item.errors.full_messages, entry.line_number end end @@ -154,8 +153,7 @@ module ProductImport @inventory_updated += 1 @updated_ids.push existing_item.id else - @importer.errors.add("#{I18n.t('admin.product_import.model.line')} \ - #{entry.line_number}:", existing_item.errors.full_messages) + assign_errors existing_item.errors.full_messages, entry.line_number end end @@ -179,8 +177,7 @@ module ProductImport @products_created += 1 @updated_ids.push product.variants.first.id else - @importer.errors.add("#{I18n.t('admin.product_import.model.line')} \ - #{entry.line_number}:", product.errors.full_messages) + assign_errors product.errors.full_messages, entry.line_number end @already_created[entry.supplier_id] = { entry.name => product.id } @@ -195,12 +192,19 @@ module ProductImport @updated_ids.push variant.id true else - @importer.errors.add("#{I18n.t('admin.product_import.model.line')} \ - #{entry.line_number}:", variant.errors.full_messages) + assign_errors variant.errors.full_messages, entry.line_number false end end + def assign_errors(errors, line_number) + @importer.errors.add( + I18n.t('admin.product_import.model.line_number', + number: line_number), + errors + ) + end + def assign_defaults(object, entry) # Assigns a default value for a specified field e.g. category='Vegetables', setting this value # either for all entries (overwrite_all), or only for those entries where the field was blank diff --git a/config/locales/en.yml b/config/locales/en.yml index ea6a746d97..51d776855a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -520,7 +520,7 @@ en: products_no_permission: you do not have permission to manage products for this enterprise inventory_no_permission: you do not have permission to create inventory for this producer none_saved: did not save any products successfully - line: Line + line_number: "Line %{number}:" index: select_file: Select a spreadsheet to upload spreadsheet: Spreadsheet From b109f6d78c131594ea9ba65245f6622bd093671c Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 16 Oct 2018 11:57:21 +1100 Subject: [PATCH 10/23] Remove temporary reporting code --- app/models/spree/address_decorator.rb | 23 ----------------------- spec/models/spree/addresses_spec.rb | 15 --------------- 2 files changed, 38 deletions(-) diff --git a/app/models/spree/address_decorator.rb b/app/models/spree/address_decorator.rb index db092f5eb2..8309083c18 100644 --- a/app/models/spree/address_decorator.rb +++ b/app/models/spree/address_decorator.rb @@ -37,27 +37,4 @@ Spree::Address.class_eval do def touch_enterprise enterprise.andand.touch end - - # We have a hard-to-track-down bug around invalid addresses with all-nil fields finding - # their way into the database. I don't know what the source of them is, so this patch - # is designed to track them down. - # This is intended to be a temporary investigative measure, and should be removed from the - # code base shortly. If it's past 17-10-2013, take it out. - # - #-- Rohan, 17-9-2913 - def create - if self.zipcode.nil? - Bugsnag.notify RuntimeError.new('Creating a Spree::Address with nil values') - end - - super - end - - def update(attribute_names = @attributes.keys) - if self.zipcode.nil? - Bugsnag.notify RuntimeError.new('Updating a Spree::Address with nil values') - end - - super(attribute_names) - end end diff --git a/spec/models/spree/addresses_spec.rb b/spec/models/spree/addresses_spec.rb index f453218610..2e2d760104 100644 --- a/spec/models/spree/addresses_spec.rb +++ b/spec/models/spree/addresses_spec.rb @@ -54,19 +54,4 @@ describe Spree::Address do expect { Spree::Address.new.country = "A country" }.to raise_error ActiveRecord::AssociationTypeMismatch end end - - describe "notifying bugsnag when saved with missing data" do - it "notifies on create" do - Bugsnag.should_receive(:notify) - a = Spree::Address.new zipcode: nil - a.save validate: false - end - - it "notifies on update" do - Bugsnag.should_receive(:notify) - a = create(:address) - a.zipcode = nil - a.save validate: false - end - end end From c4437a643753f4c2dd3f84423450b150ef9b9589 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 16 Oct 2018 12:03:11 +1100 Subject: [PATCH 11/23] Style address decorator --- .rubocop_todo.yml | 3 --- app/models/spree/address_decorator.rb | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 378129593e..cfc4e57e90 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -674,7 +674,6 @@ Layout/SpaceAroundOperators: - 'app/controllers/checkout_controller.rb' - 'app/helpers/admin/business_model_configuration_helper.rb' - 'app/jobs/update_billable_periods.rb' - - 'app/models/spree/address_decorator.rb' - 'app/overrides/remove_search_bar.rb' - 'app/overrides/remove_side_bar.rb' - 'app/overrides/replace_shipping_address_form_with_distributor_details.rb' @@ -1955,7 +1954,6 @@ Style/HashSyntax: - 'app/models/open_food_network/calculator/weight.rb' - 'app/models/order_cycle.rb' - 'app/models/product_distribution.rb' - - 'app/models/spree/address_decorator.rb' - 'app/models/spree/adjustment_decorator.rb' - 'app/models/spree/classification_decorator.rb' - 'app/models/spree/gateway/migs.rb' @@ -2313,7 +2311,6 @@ Style/RedundantSelf: - 'app/models/open_food_network/calculator/weight.rb' - 'app/models/order_cycle.rb' - 'app/models/producer_property.rb' - - 'app/models/spree/address_decorator.rb' - 'app/models/spree/calculator/flat_percent_item_total_decorator.rb' - 'app/models/spree/calculator/flexi_rate_decorator.rb' - 'app/models/spree/calculator/per_item_decorator.rb' diff --git a/app/models/spree/address_decorator.rb b/app/models/spree/address_decorator.rb index 8309083c18..8e8fc287ce 100644 --- a/app/models/spree/address_decorator.rb +++ b/app/models/spree/address_decorator.rb @@ -6,7 +6,7 @@ Spree::Address.class_eval do geocoded_by :geocode_address - delegate :name, :to => :state, :prefix => true, :allow_nil => true + delegate :name, to: :state, prefix: true, allow_nil: true def geocode_address geocode_address = [address1, address2, zipcode, city, country.andand.name, state.andand.name] @@ -27,7 +27,7 @@ Spree::Address.class_eval do end def address_part2 - address_part2= [city, zipcode, state.andand.name] + address_part2 = [city, zipcode, state.andand.name] filtered_address = address_part2.select{ |field| !field.nil? && field != '' } filtered_address.compact.join(', ') end From 34849c441a5c6880387560e5e6bf8833321ff7bf Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 16 Oct 2018 12:09:18 +1100 Subject: [PATCH 12/23] Reduce complexity and duplication --- app/models/spree/address_decorator.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/models/spree/address_decorator.rb b/app/models/spree/address_decorator.rb index 8e8fc287ce..ea20b1cf71 100644 --- a/app/models/spree/address_decorator.rb +++ b/app/models/spree/address_decorator.rb @@ -10,26 +10,22 @@ Spree::Address.class_eval do def geocode_address geocode_address = [address1, address2, zipcode, city, country.andand.name, state.andand.name] - filtered_address = geocode_address.select{ |field| !field.nil? && field != '' } - filtered_address.compact.join(', ') + render_address(geocode_address) end def full_address full_address = [address1, address2, city, zipcode, state.andand.name] - filtered_address = full_address.select{ |field| !field.nil? && field != '' } - filtered_address.compact.join(', ') + render_address(full_address) end def address_part1 address_part1 = [address1, address2] - filtered_address = address_part1.select{ |field| !field.nil? && field != '' } - filtered_address.compact.join(', ') + render_address(address_part1) end def address_part2 address_part2 = [city, zipcode, state.andand.name] - filtered_address = address_part2.select{ |field| !field.nil? && field != '' } - filtered_address.compact.join(', ') + render_address(address_part2) end private @@ -37,4 +33,9 @@ Spree::Address.class_eval do def touch_enterprise enterprise.andand.touch end + + def render_address(parts) + filtered_address = parts.select{ |field| !field.nil? && field != '' } + filtered_address.compact.join(', ') + end end From 5021ed9c6942c89321ce67286909fed5c155a687 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 16 Oct 2018 12:11:31 +1100 Subject: [PATCH 13/23] Simplify by using Rails tools --- app/models/spree/address_decorator.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/spree/address_decorator.rb b/app/models/spree/address_decorator.rb index ea20b1cf71..592f9703cc 100644 --- a/app/models/spree/address_decorator.rb +++ b/app/models/spree/address_decorator.rb @@ -35,7 +35,6 @@ Spree::Address.class_eval do end def render_address(parts) - filtered_address = parts.select{ |field| !field.nil? && field != '' } - filtered_address.compact.join(', ') + parts.select(&:present?).join(', ') end end From a8705ca179494ddd75edb529137de579fce219ad Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 16 Oct 2018 12:13:08 +1100 Subject: [PATCH 14/23] Simplify address methods --- app/models/spree/address_decorator.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/models/spree/address_decorator.rb b/app/models/spree/address_decorator.rb index 592f9703cc..04c8014d46 100644 --- a/app/models/spree/address_decorator.rb +++ b/app/models/spree/address_decorator.rb @@ -9,23 +9,19 @@ Spree::Address.class_eval do delegate :name, to: :state, prefix: true, allow_nil: true def geocode_address - geocode_address = [address1, address2, zipcode, city, country.andand.name, state.andand.name] - render_address(geocode_address) + render_address([address1, address2, zipcode, city, country.andand.name, state.andand.name]) end def full_address - full_address = [address1, address2, city, zipcode, state.andand.name] - render_address(full_address) + render_address([address1, address2, city, zipcode, state.andand.name]) end def address_part1 - address_part1 = [address1, address2] - render_address(address_part1) + render_address([address1, address2]) end def address_part2 - address_part2 = [city, zipcode, state.andand.name] - render_address(address_part2) + render_address([city, zipcode, state.andand.name]) end private From 61797fff56dac6c5a0e7357c9331d2af3b0ff82c Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 16 Oct 2018 15:18:44 +1100 Subject: [PATCH 15/23] Restrict deletion of address explicitely Enterprises have an `address_id` which must point to a valid `Spree::Address`. As Rubocop suggested, I restricted the deletion of addresses when they are still associated to an enterprise. Without declaring `dependent: :restrict`, trying to delete the address would raise `ActiveRecord::InvalidForeignKey`. Now it is more specific and raises `ActiveRecord::DeleteRestrictionError`. I didn't find code rescuing the InvalidForeignKey when deleting addresses. I actually think that we never delete addresses. So this change should not have any impact on the execution. --- .rubocop_todo.yml | 1 - app/models/spree/address_decorator.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cfc4e57e90..8d06d3cfad 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1440,7 +1440,6 @@ Rails/HasManyOrHasOneDependent: - 'app/models/customer.rb' - 'app/models/enterprise.rb' - 'app/models/order_cycle.rb' - - 'app/models/spree/address_decorator.rb' - 'app/models/spree/adjustment_decorator.rb' - 'app/models/spree/order_decorator.rb' - 'app/models/spree/payment_method_decorator.rb' diff --git a/app/models/spree/address_decorator.rb b/app/models/spree/address_decorator.rb index 04c8014d46..ff7c1f0665 100644 --- a/app/models/spree/address_decorator.rb +++ b/app/models/spree/address_decorator.rb @@ -1,5 +1,5 @@ Spree::Address.class_eval do - has_one :enterprise + has_one :enterprise, dependent: :restrict belongs_to :country, class_name: "Spree::Country" after_save :touch_enterprise From 8fb81bb6a7da16f8ca0124b448e5315aa5c8fba2 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 16 Oct 2018 16:49:52 +1100 Subject: [PATCH 16/23] Configure Geocoder with API key as required by Google --- config/initializers/geocoder.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 config/initializers/geocoder.rb diff --git a/config/initializers/geocoder.rb b/config/initializers/geocoder.rb new file mode 100644 index 0000000000..35b5510d5e --- /dev/null +++ b/config/initializers/geocoder.rb @@ -0,0 +1,6 @@ +# Google requires an API key with a billing account to use their API. +# The key is stored in config/application.yml. +Geocoder.configure( + use_https: true, + api_key: ENV.fetch('GOOGLE_MAPS_API_KEY', nil) +) From e96cab957a745d7d04f30f269e75664853a78d97 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 18 Oct 2018 10:52:46 +1100 Subject: [PATCH 17/23] Convert specs to RSpec 3.7.1 syntax with Transpec This conversion is done by Transpec 3.3.0 with the following command: transpec spec/models/spree/addresses_spec.rb * 13 conversions from: obj.should to: expect(obj).to * 2 conversions from: it { should ... } to: it { is_expected.to ... } * 1 conversion from: obj.should_not to: expect(obj).not_to For more details: https://github.com/yujinakayama/transpec#supported-conversions --- spec/models/spree/addresses_spec.rb | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/spec/models/spree/addresses_spec.rb b/spec/models/spree/addresses_spec.rb index 2e2d760104..8d46446181 100644 --- a/spec/models/spree/addresses_spec.rb +++ b/spec/models/spree/addresses_spec.rb @@ -2,30 +2,30 @@ require 'spec_helper' describe Spree::Address do describe "associations" do - it { should have_one(:enterprise) } + it { is_expected.to have_one(:enterprise) } end describe "delegation" do - it { should delegate(:name).to(:state).with_prefix } + it { is_expected.to delegate(:name).to(:state).with_prefix } end describe "geocode address" do let(:address) { FactoryBot.build(:address) } it "should include address1, address2, zipcode, city, state and country" do - address.geocode_address.should include(address.address1) - address.geocode_address.should include(address.address2) - address.geocode_address.should include(address.zipcode) - address.geocode_address.should include(address.city) - address.geocode_address.should include(address.state.name) - address.geocode_address.should include(address.country.name) + expect(address.geocode_address).to include(address.address1) + expect(address.geocode_address).to include(address.address2) + expect(address.geocode_address).to include(address.zipcode) + expect(address.geocode_address).to include(address.city) + expect(address.geocode_address).to include(address.state.name) + expect(address.geocode_address).to include(address.country.name) end it "should not include empty fields" do address.address2 = nil address.city = "" - address.geocode_address.split(',').length.should eql(4) + expect(address.geocode_address.split(',').length).to eql(4) end end @@ -33,19 +33,19 @@ describe Spree::Address do let(:address) { FactoryBot.build(:address) } it "should include address1, address2, zipcode, city and state" do - address.full_address.should include(address.address1) - address.full_address.should include(address.address2) - address.full_address.should include(address.zipcode) - address.full_address.should include(address.city) - address.full_address.should include(address.state.name) - address.full_address.should_not include(address.country.name) + expect(address.full_address).to include(address.address1) + expect(address.full_address).to include(address.address2) + expect(address.full_address).to include(address.zipcode) + expect(address.full_address).to include(address.city) + expect(address.full_address).to include(address.state.name) + expect(address.full_address).not_to include(address.country.name) end it "should not include empty fields" do address.address2 = nil address.city = "" - address.full_address.split(',').length.should eql(3) + expect(address.full_address.split(',').length).to eql(3) end end From d197c8587f10e3d7de69771a2debba12c08b6d26 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 18 Oct 2018 11:06:32 +1100 Subject: [PATCH 18/23] Test address deletion --- spec/models/spree/addresses_spec.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/spec/models/spree/addresses_spec.rb b/spec/models/spree/addresses_spec.rb index 8d46446181..321d6b71ef 100644 --- a/spec/models/spree/addresses_spec.rb +++ b/spec/models/spree/addresses_spec.rb @@ -1,6 +1,9 @@ require 'spec_helper' describe Spree::Address do + let(:address) { build(:address) } + let(:enterprise_address) { build(:address, enterprise: build(:enterprise)) } + describe "associations" do it { is_expected.to have_one(:enterprise) } end @@ -9,9 +12,19 @@ describe Spree::Address do it { is_expected.to delegate(:name).to(:state).with_prefix } end - describe "geocode address" do - let(:address) { FactoryBot.build(:address) } + describe "destroy" do + it "can be deleted" do + expect { address.destroy }.to_not raise_error + end + it "cannot be deleted with associated enterprise" do + expect do + enterprise_address.destroy + end.to raise_error ActiveRecord::DeleteRestrictionError + end + end + + describe "geocode address" do it "should include address1, address2, zipcode, city, state and country" do expect(address.geocode_address).to include(address.address1) expect(address.geocode_address).to include(address.address2) From 9698fd3c5ae76513c377a203ad301769179b7d2d Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 18 Oct 2018 11:07:16 +1100 Subject: [PATCH 19/23] Style spec --- spec/models/spree/addresses_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/models/spree/addresses_spec.rb b/spec/models/spree/addresses_spec.rb index 321d6b71ef..5d78cadcf2 100644 --- a/spec/models/spree/addresses_spec.rb +++ b/spec/models/spree/addresses_spec.rb @@ -64,7 +64,9 @@ describe Spree::Address do describe "setters" do it "lets us set a country" do - expect { Spree::Address.new.country = "A country" }.to raise_error ActiveRecord::AssociationTypeMismatch + expect do + Spree::Address.new.country = "A country" + end.to raise_error ActiveRecord::AssociationTypeMismatch end end end From c911462737e8a930f07c8b9ad87494f3b9aa121a Mon Sep 17 00:00:00 2001 From: Transifex-Openfoodnetwork Date: Sat, 20 Oct 2018 02:04:33 +1100 Subject: [PATCH 20/23] Updating translations for config/locales/en_GB.yml --- config/locales/en_GB.yml | 83 +++++++++++++++++++++++++++++++++++----- 1 file changed, 73 insertions(+), 10 deletions(-) diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml index 14021d1398..8a89b35ac7 100644 --- a/config/locales/en_GB.yml +++ b/config/locales/en_GB.yml @@ -55,6 +55,7 @@ en_GB: user_registrations: spree_user: signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." + unknown_error: "Something went wrong while creating your account. Check your email address and try again." failure: invalid: | Invalid email or password. @@ -64,6 +65,9 @@ en_GB: user_passwords: spree_user: updated_not_active: "Your password has been reset, but your email has not been confirmed yet." + models: + order_cycle: + cloned_order_cycle_name: "COPY OF %{order_cycle}" enterprise_mailer: confirmation_instructions: subject: "Please confirm the email address for %{enterprise}" @@ -71,9 +75,26 @@ en_GB: subject: "%{enterprise} is now on %{sitename}" invite_manager: subject: "%{enterprise} has invited you to be a manager" + order_mailer: + cancel_email: + dear_customer: "Dear Customer," + instructions: "Your order has been CANCELED. Please retain this cancellation information for your records." + order_summary_canceled: "Order Summary [CANCELED]" + subject: "Cancellation of Order" + subtotal: "Subtotal: %{subtotal}" + total: "Order Total: %{total}" producer_mailer: order_cycle: subject: "Order cycle report for %{producer}" + shipment_mailer: + shipped_email: + dear_customer: "Dear Customer," + instructions: "Your order has been shipped" + shipment_summary: "Shipment Summary" + subject: "Shipment Notification" + thanks: "Thank you for your order with us." + track_information: "Tracking Information: %{tracking}" + track_link: "Tracking Link: %{url}" subscription_mailer: placement_summary_email: subject: A summary of recently placed subscription orders @@ -438,11 +459,12 @@ en_GB: conditional_blank: can't be blank if unit_type is blank no_product: did not match any products in the database not_found: not found in database + not_updatable: cannot be updated on existing products via product import blank: can't be blank products_no_permission: you do not have permission to manage products for this enterprise inventory_no_permission: you do not have permission to create inventory for this producer none_saved: did not save any products successfully - line: Line + line_number: "Line %{number}:" index: select_file: Select a spreadsheet to upload spreadsheet: Spreadsheet @@ -496,6 +518,11 @@ en_GB: inventory_to_reset: Existing inventory items will have their stock reset to zero line: Line item_line: Item line + import_review: + not_updatable_tip: "The following fields cannot be updated via bulk import for existing products:" + fields_ignored: These fields will be ignored when the imported products are saved. + entries_table: + not_updatable: This field is not updatable via bulk import on existing products save_results: final_results: Import final results products_created: Products created @@ -536,9 +563,6 @@ en_GB: controls: back_to_my_inventory: Back to my inventory orders: - index: - capture: "Capture" - ship: "Ship" invoice_email_sent: 'Invoice email has been sent' order_email_resent: 'Order email has been resent' bulk_management: @@ -745,7 +769,7 @@ en_GB: change_type_form: producer_profile: Producer Profile connect_ofn: Connect through OFN - always_free: ALWAYS FREE + always_free: Plans starting from £1/month producer_description_text: Add your products to Open Food Network, allowing hubs to stock your products in their stores. producer_shop: Producer Shop sell_your_produce: Sell your own produce @@ -782,6 +806,14 @@ en_GB: new: title: New Enterprise back_link: Back to enterprises list + remove_logo: + remove: "Remove Image" + removed_successfully: "Logo removed successfully" + immediate_removal_warning: "The logo will be removed immediately after you confirm." + remove_promo_image: + remove: "Remove Image" + removed_successfully: "Promo image removed successfully" + immediate_removal_warning: "The promo image will be removed immediately after you confirm." welcome: welcome_title: Welcome to the Open Food Network! welcome_text: You have successfully created a @@ -815,7 +847,10 @@ en_GB: coordinator_fees: add: Add coordinator fee filters: + search_by_order_cycle_name: "Search by Order Cycle name..." involving: "Involving" + any_enterprise: "Any Enterprise" + any_schedule: "Any Schedule" form: incoming: Incoming supplier: Supplier @@ -1020,6 +1055,11 @@ en_GB: stripe_connect_fail: Sorry, the connection of your Stripe account failed stripe_connect_settings: resource: Stripe Connect configuration + api: + enterprise_logo: + destroy_attachment_does_not_exist: "Logo does not exist" + enterprise_promo_image: + destroy_attachment_does_not_exist: "Promo image does not exist" checkout: already_ordered: cart: "cart" @@ -1105,6 +1145,8 @@ en_GB: menu_2_url: "/map" menu_3_title: "Services" menu_3_url: "https://about.openfoodnetwork.org.uk/services" + menu_4_title: "Groups" + menu_4_url: "/groups" menu_5_title: "About" menu_5_url: "https://about.openfoodnetwork.org.uk" menu_6_title: "Blog" @@ -1126,6 +1168,7 @@ en_GB: footer_email: "Email" footer_links_md: "Links" footer_about_url: "About URL" + user_guide_link: "User Guide Link" name: Name first_name: First Name last_name: Last Name @@ -1218,6 +1261,7 @@ en_GB: statistics_cookies_desc: "The following are not strictly necessary, but help to provide you with the best user experience by allowing us to analyse user behaviour, identify which features you use most, or don’t use, understand user experience issues, etc." statistics_cookies_analytics_desc_html: "To collect and analyse platform usage data, we use Google Analytics." statistics_cookies_matomo_desc_html: "To collect and analyse platform usage data, we use Matomo (ex Piwik), an open source analytics tool that is GDPR compliant and protects your privacy." + statistics_cookies_matomo_optout: "Would you like to opt-out of Matomo analytics? We use Matomo to help us improve our service, but we don't collect any personal data." cookie_analytics_utma_desc: "Used to distinguish users and sessions. The cookie is created when the javascript library executes and no existing __utma cookies exists. The cookie is updated every time data is sent to Google Analytics." cookie_analytics_utmt_desc: "Used to throttle request rate." cookie_analytics_utmb_desc: "Used to determine new sessions/visits. The cookie is created when the javascript library executes and no existing __utmb cookies exists. The cookie is updated every time data is sent to Google Analytics." @@ -2285,13 +2329,13 @@ en_GB: saving: SAVING enterprise_package: hub_profile: Hub Profile - hub_profile_cost: "COST: Pay What You Can" + hub_profile_cost: "COST: Plans starting from £1/month" hub_profile_text1: > People can find and contact you on the Open Food Network. Your enterprise will be visible on the map, and will be searchable in listings. hub_profile_text2: > - Having a profile, and making connections within your local food system - through the Open Food Network will always be free. + As a producer, making connections within your local food system through + the Open Food Network will always be free. hub_shop: Hub Shop hub_shop_text1: > Your enterprise is the backbone of your local food system. You aggregate @@ -2311,7 +2355,7 @@ en_GB: Click on an option to see more detailed information about each package, and hit the red SAVE button when you are done! profile_only: Profile Only - profile_only_cost: "COST: Pay What You Can" + profile_only_cost: "COST: Plans starting from £1/month" profile_only_text1: > A profile makes you visible and contactable to others and is a way to share your story. @@ -2342,7 +2386,7 @@ en_GB: so no matter your situation, we want to provide the tools you need to run your organisation or local food business. get_listing: Get a listing - always_free: Pay What You Can + always_free: Plans starting from £1/month sell_produce_others: Sell produce from others sell_own_produce: Sell your own produce sell_both: Sell produce from self and others @@ -2374,6 +2418,9 @@ en_GB: resolve: Resolve new_tag_rule_dialog: select_rule_type: "Select a rule type:" + orders: + index: + per_page: "%{results} per page" resend_user_email_confirmation: resend: "Resend" sending: "Resend..." @@ -2422,7 +2469,9 @@ en_GB: This will set stock level to zero on all products for this enterprise that are not present in the uploaded file. order_cycles: + create_failure: "Failed to create order cycle" update_success: 'Your order cycle has been updated.' + update_failure: "Failed to update order cycle" no_distributors: There are no distributors in this order cycle. This order cycle will not be visible to customers until you add one. Would you like to continue saving this order cycle?' enterprises: producer: "Producer" @@ -2443,8 +2492,22 @@ en_GB: my_account: "My account" date: "Date" time: "Time" + layouts: + admin: + header: + store: Store admin: + product_properties: + index: + inherits_properties_checkbox_hint: "Inherit properties from %{supplier}? (unless overridden above)" orders: + index: + listing_orders: "Listing Orders" + capture: "Capture" + ship: "Ship" + edit: "Edit" + next: "Next" + no_orders_found: "No Orders Found" invoice: issued_on: Issued on tax_invoice: TAX INVOICE From 42c1584e6f809284a04b16b2a6f5fb80ede299a0 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 22 Oct 2018 17:55:43 +0100 Subject: [PATCH 21/23] Fix pagination conflict with LineItemsCtrl requests --- .../admin/orders_controller_decorator.rb | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/app/controllers/spree/admin/orders_controller_decorator.rb b/app/controllers/spree/admin/orders_controller_decorator.rb index 88110da52f..fe8dc46445 100644 --- a/app/controllers/spree/admin/orders_controller_decorator.rb +++ b/app/controllers/spree/admin/orders_controller_decorator.rb @@ -63,12 +63,7 @@ Spree::Admin::OrdersController.class_eval do format.json do render json: { orders: ActiveModel::ArraySerializer.new(@orders, each_serializer: Api::Admin::OrderSerializer), - pagination: { - results: @orders.total_count, - pages: @orders.num_pages.to_i, - page: params[:page].to_i, - per_page: params[:per_page].to_i - } + pagination: pagination_data } end end @@ -117,7 +112,30 @@ Spree::Admin::OrdersController.class_eval do @search.result.includes([:user, :shipments, :payments]).distributed_by_user(spree_current_user) end - @search.result.page(params[:page]).per(params[:per_page] || Spree::Config[:orders_per_page]) + search_results + end + + def search_results + if using_pagination? + @search.result.page(params[:page]).per(params[:per_page] || Spree::Config[:orders_per_page]) + else + @search.result + end + end + + def using_pagination? + params[:per_page] + end + + def pagination_data + if using_pagination? + { + results: @orders.total_count, + pages: @orders.num_pages, + page: params[:page].to_i, + per_page: params[:per_page].to_i + } + end end def require_distributor_abn From c17939631fc70608625f422b6a0eda745a90c58d Mon Sep 17 00:00:00 2001 From: Transifex-Openfoodnetwork Date: Thu, 25 Oct 2018 09:31:36 +1100 Subject: [PATCH 22/23] Updating translations for config/locales/en_US.yml --- config/locales/en_US.yml | 41 +++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/config/locales/en_US.yml b/config/locales/en_US.yml index d1f41a8849..c6573470f5 100644 --- a/config/locales/en_US.yml +++ b/config/locales/en_US.yml @@ -55,6 +55,7 @@ en_US: user_registrations: spree_user: signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." + unknown_error: "Oops! Something went wrong while creating your account. Please check your email address and try again." failure: invalid: | Invalid email or password. @@ -147,7 +148,7 @@ en_US: cancel_order: "Cancel Order" confirm_send_invoice: "An invoice for this order will be sent to the customer. Are you sure you want to continue?" confirm_resend_order_confirmation: "Are you sure you want to resend the order confirmation email?" - must_have_valid_business_number: " %{enterprise_name}must have a company registration # before invoices can be sent." + must_have_valid_business_number: " %{enterprise_name}must have a Tax ID or W9 before invoices can be sent." invoice: "Invoice" percentage_of_sales: "%{percentage} of sales" capped_at_cap: "capped at %{cap}" @@ -458,11 +459,12 @@ en_US: conditional_blank: can't be blank if unit_type is blank no_product: did not match any products in the database not_found: not found in database + not_updatable: cannot be updated on existing products via product import blank: can't be blank products_no_permission: you do not have permission to manage products for this enterprise inventory_no_permission: you do not have permission to create inventory for this producer none_saved: did not save any products successfully - line: Line + line_number: "Line %{number}:" index: select_file: Select a spreadsheet to upload spreadsheet: Spreadsheet @@ -498,6 +500,7 @@ en_US: no_name: No name blank_supplier: some products have blank supplier name reset_absent?: Reset absent products + reset_absent_tip: Set stock to zero for all existing products not present in the file overwrite_all: Overwrite all overwrite_empty: Overwrite if empty default_stock: Set stock level @@ -505,6 +508,7 @@ en_US: default_shipping_cat: Set shipping category default_available_date: Set available date validation_overview: Import validation overview + entries_found: Entries found in imported file entries_with_errors: Items contain errors and will not be imported products_to_create: Products will be created products_to_update: Products will be updated @@ -514,6 +518,9 @@ en_US: inventory_to_reset: Existing inventory items will have their stock reset to zero line: Line item_line: Item line + import_review: + not_updatable_tip: "The following fields cannot be updated via bulk import for existing products:" + fields_ignored: These fields will be ignored when the imported products are saved. save_results: final_results: Import final results products_created: Products created @@ -554,9 +561,6 @@ en_US: controls: back_to_my_inventory: Back to my inventory orders: - index: - capture: "Capture" - ship: "Ship" invoice_email_sent: 'Invoice email has been sent' order_email_resent: 'Order email has been resent' bulk_management: @@ -597,7 +601,7 @@ en_US: desc_long: About Us desc_long_placeholder: Tell customers about yourself. This information appears on your public profile. business_details: - abn: Tax ID Number + abn: Tax ID Number or EIN (optional) abn_placeholder: eg. 123456789 acn: Legal Business Name acn_placeholder: eg. Martin's Produce LLC @@ -1124,7 +1128,7 @@ en_US: tax_total: "Total tax (%{rate}):" total_excl_tax: "Total (Excl. tax):" total_incl_tax: "Total (Incl. tax):" - abn: "Tax ID No." + abn: "Tax ID Number or EIN (optional)" acn: "Legal Business Name" invoice_issued_on: "Invoice issued on:" order_number: "Invoice number:" @@ -1786,7 +1790,7 @@ en_US: enterprise_long_desc_placeholder: "This is your opportunity to tell the story of your enterprise - what makes you different and wonderful? We'd suggest keeping your description to under 600 characters or 150 words." enterprise_long_desc_length: "%{num} characters / up to 600 recommended" enterprise_limit: Enterprise Limit - enterprise_abn: "Tax ID No." + enterprise_abn: "Tax ID Number or EIN (optional)" enterprise_abn_placeholder: "eg. 123456789" enterprise_acn: "Legal Business Name" enterprise_acn_placeholder: "eg. Justins Produce LLC" @@ -2283,7 +2287,7 @@ en_US: unsaved_changes: You have unsaved changes all_changes_saved_successfully: All changes saved successfully oh_no: "Oh no! I was unable to save your changes." - unauthorized: "You are unauthorised to access this page." + unauthorized: "You are unauthorized to access this page." error: Error unavailable: Unavailable profile: Profile @@ -2492,6 +2496,12 @@ en_US: index: inherits_properties_checkbox_hint: "Inherit properties from %{supplier}? (unless overridden above)" orders: + index: + capture: "Capture" + ship: "Ship" + edit: "Edit" + next: "Next" + no_orders_found: "No Orders Found" invoice: issued_on: Issued on tax_invoice: TAX INVOICE @@ -2551,6 +2561,7 @@ en_US: inherits_properties?: Inherits Properties? available_on: Available On av_on: "Av. On" + import_date: "Import Date" products_variant: variant_has_n_overrides: "This variant has %{n} override(s)" new_variant: "New variant" @@ -2598,6 +2609,8 @@ en_US: js_format: 'yy-mm-dd' inventory: Inventory orders: + edit: + login_to_view_order: "Please log in to view your order." bought: item: "Already ordered in this cycle" order_mailer: @@ -2689,5 +2702,15 @@ en_US: total: Total paid?: Paid? view: View + saved_cards: + default?: Default? + delete?: Delete? + cards: + authorised_shops: Authorized Shops + authorised_shops_popover: This is the list of shops which are permitted to charge your default credit card for any subscriptions (ie. repeating orders) you may have. Your card details will be kept secure and will not be shared with shop owners. You will always be notified when you are charged. + saved_cards_popover: This is the list of cards you have opted to save for later use. Your 'default' will be selected automatically when you checkout an order, and can be charged by any shops you have allowed to do so (see right). + authorised_shops: + shop_name: "Shop Name" + allow_charges?: "Allow Charges?" localized_number: invalid_format: has an invalid format. Please enter a number. From cd5c23993ab377386b74385f1ba39d0a6b38e007 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 25 Oct 2018 14:08:04 +1100 Subject: [PATCH 23/23] Update rubocop todo list Since we activated more cops in 0ac16ce0964cc1379f28804beeed17f8871d6e74 we had a lot of files missing in the todo list. They are likely from other pull requests that have been open at the same time. This is a quick update so that rubocop gives us some useful feedback again. --- .rubocop_todo.yml | 151 ++++++++++++++++++++++++++-------------------- 1 file changed, 87 insertions(+), 64 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8d06d3cfad..39510bf5f5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 1400` -# on 2018-09-19 19:24:45 +0200 using RuboCop version 0.57.2. +# on 2018-10-25 13:57:32 +1100 using RuboCop version 0.57.2. # 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 @@ -57,7 +57,7 @@ Layout/AlignHash: - 'spec/models/spree/shipping_method_spec.rb' - 'spec/models/spree/variant_spec.rb' -# Offense count: 62 +# Offense count: 60 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: with_first_parameter, with_fixed_indentation @@ -67,7 +67,6 @@ Layout/AlignParameters: - 'app/models/enterprise.rb' - 'app/models/enterprise_group.rb' - 'app/models/enterprise_relationship.rb' - - 'app/models/spree/variant_decorator.rb' - 'app/serializers/api/address_serializer.rb' - 'app/serializers/api/enterprise_serializer.rb' - 'app/serializers/api/shipping_method_serializer.rb' @@ -126,7 +125,7 @@ Layout/ElseAlignment: - 'app/serializers/api/admin/order_cycle_serializer.rb' - 'lib/open_food_network/sales_tax_report.rb' -# Offense count: 201 +# Offense count: 197 # Cop supports --auto-correct. Layout/EmptyLines: Exclude: @@ -182,7 +181,6 @@ Layout/EmptyLines: - 'app/serializers/api/enterprise_serializer.rb' - 'lib/open_food_network/cached_products_renderer.rb' - 'lib/open_food_network/enterprise_fee_applicator.rb' - - 'lib/open_food_network/enterprise_fee_calculator.rb' - 'lib/open_food_network/enterprise_issue_validator.rb' - 'lib/open_food_network/integrity_checker.rb' - 'lib/open_food_network/lettuce_share_report.rb' @@ -201,7 +199,6 @@ Layout/EmptyLines: - 'lib/tasks/cache.rake' - 'lib/tasks/dev.rake' - 'lib/tasks/enterprises.rake' - - 'lib/tasks/users.rake' - 'spec/archive/features/consumer/checkout_spec.rb' - 'spec/controllers/admin/column_preferences_controller_spec.rb' - 'spec/controllers/admin/enterprises_controller_spec.rb' @@ -220,7 +217,6 @@ Layout/EmptyLines: - 'spec/features/admin/enterprises_spec.rb' - 'spec/features/admin/order_cycles_spec.rb' - 'spec/features/admin/orders_spec.rb' - - 'spec/features/admin/payment_method_spec.rb' - 'spec/features/admin/product_import_spec.rb' - 'spec/features/admin/products_spec.rb' - 'spec/features/admin/reports_spec.rb' @@ -268,7 +264,7 @@ Layout/EmptyLinesAroundArguments: Exclude: - 'spec/archive/features/consumer/checkout_spec.rb' -# Offense count: 61 +# Offense count: 59 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, no_empty_lines @@ -285,7 +281,6 @@ Layout/EmptyLinesAroundBlockBody: - 'lib/open_food_network/group_buy_report.rb' - 'lib/spree/money_decorator.rb' - 'lib/tasks/dev.rake' - - 'lib/tasks/users.rake' - 'spec/controllers/admin/order_cycles_controller_spec.rb' - 'spec/controllers/admin/tag_rules_controller_spec.rb' - 'spec/controllers/spree/admin/orders_controller_spec.rb' @@ -315,7 +310,6 @@ Layout/EmptyLinesAroundBlockBody: - 'spec/lib/open_food_network/user_balance_calculator_spec.rb' - 'spec/models/billable_period_spec.rb' - 'spec/models/product_distribution_spec.rb' - - 'spec/models/product_import/product_list_spec.rb' - 'spec/models/spree/ability_spec.rb' - 'spec/models/spree/product_spec.rb' - 'spec/models/tag_rule/filter_payment_methods_spec.rb' @@ -368,7 +362,7 @@ Layout/EndAlignment: - 'app/serializers/api/admin/for_order_cycle/supplied_product_serializer.rb' - 'app/serializers/api/admin/order_cycle_serializer.rb' -# Offense count: 49 +# Offense count: 47 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. Layout/ExtraSpacing: @@ -378,7 +372,6 @@ Layout/ExtraSpacing: - 'app/helpers/admin/injection_helper.rb' - 'app/models/enterprise.rb' - 'app/models/spree/classification_decorator.rb' - - 'app/models/spree/product_set.rb' - 'app/serializers/api/enterprise_serializer.rb' - 'config.ru' - 'lib/open_food_network/bulk_coop_report.rb' @@ -394,7 +387,6 @@ Layout/ExtraSpacing: - 'spec/features/admin/reports_spec.rb' - 'spec/features/consumer/groups_spec.rb' - 'spec/features/consumer/shopping/shopping_spec.rb' - - 'spec/helpers/cookies_policy_helper_spec.rb' - 'spec/lib/open_food_network/enterprise_fee_calculator_spec.rb' - 'spec/lib/open_food_network/reports/rule_spec.rb' - 'spec/models/enterprise_fee_spec.rb' @@ -444,7 +436,7 @@ Layout/IndentationConsistency: - 'spec/models/spree/line_item_spec.rb' - 'spec/models/spree/product_spec.rb' -# Offense count: 20 +# Offense count: 19 # Cop supports --auto-correct. # Configuration parameters: Width, IgnoredPatterns. Layout/IndentationWidth: @@ -455,7 +447,6 @@ Layout/IndentationWidth: - 'app/serializers/api/admin/for_order_cycle/enterprise_serializer.rb' - 'app/serializers/api/admin/for_order_cycle/supplied_product_serializer.rb' - 'app/serializers/api/admin/order_cycle_serializer.rb' - - 'lib/discourse/single_sign_on.rb' - 'spec/features/consumer/shopping/variant_overrides_spec.rb' - 'spec/helpers/admin/business_model_configuration_helper_spec.rb' - 'spec/helpers/groups_helper_spec.rb' @@ -472,7 +463,7 @@ Layout/LeadingBlankLines: Exclude: - 'lib/tasks/dev.rake' -# Offense count: 46 +# Offense count: 44 # Cop supports --auto-correct. Layout/LeadingCommentSpace: Exclude: @@ -484,7 +475,6 @@ Layout/LeadingCommentSpace: - 'app/serializers/api/address_serializer.rb' - 'app/serializers/api/enterprise_serializer.rb' - 'app/serializers/api/product_serializer.rb' - - 'lib/tasks/users.rake' - 'spec/archive/features/consumer/checkout_spec.rb' - 'spec/controllers/spree/api/line_items_controller_spec.rb' - 'spec/features/admin/products_spec.rb' @@ -554,7 +544,7 @@ Layout/MultilineMethodCallIndentation: - 'spec/lib/open_food_network/cached_products_renderer_spec.rb' - 'spec/serializers/variant_serializer_spec.rb' -# Offense count: 28 +# Offense count: 26 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented @@ -566,7 +556,6 @@ Layout/MultilineOperationIndentation: - 'app/helpers/enterprises_helper.rb' - 'app/models/producer_property.rb' - 'app/models/spree/ability_decorator.rb' - - 'app/models/spree/product_set.rb' - 'app/models/variant_override_set.rb' - 'lib/open_food_network/accounts_and_billing_settings_validator.rb' - 'lib/open_food_network/order_cycle_permissions.rb' @@ -666,7 +655,7 @@ Layout/SpaceAroundEqualsInParameterDefault: - 'spec/support/request/distribution_helper.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 57 +# Offense count: 55 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment. Layout/SpaceAroundOperators: @@ -686,7 +675,6 @@ Layout/SpaceAroundOperators: - 'spec/features/admin/bulk_product_update_spec.rb' - 'spec/features/consumer/shopping/checkout_spec.rb' - 'spec/helpers/checkout_helper_spec.rb' - - 'spec/helpers/cookies_policy_helper_spec.rb' - 'spec/helpers/order_cycles_helper_spec.rb' - 'spec/jobs/update_billable_periods_spec.rb' - 'spec/lib/open_food_network/order_grouper_spec.rb' @@ -798,7 +786,7 @@ Layout/SpaceInsideBlockBraces: - 'spec/spec_helper.rb' - 'spec/support/cancan_helper.rb' -# Offense count: 734 +# Offense count: 728 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. # SupportedStyles: space, no_space, compact @@ -842,7 +830,6 @@ Layout/SpaceInsideHashLiteralBraces: - 'lib/open_food_network/sales_tax_report.rb' - 'lib/open_food_network/variant_and_line_item_naming.rb' - 'lib/open_food_network/xero_invoices_report.rb' - - 'lib/tasks/users.rake' - 'spec/controllers/admin/accounts_and_billing_settings_controller_spec.rb' - 'spec/controllers/admin/business_model_configuration_controller_spec.rb' - 'spec/controllers/admin/enterprises_controller_spec.rb' @@ -948,13 +935,12 @@ Layout/TrailingBlankLines: Exclude: - 'spec/controllers/cart_controller_spec.rb' -# Offense count: 64 +# Offense count: 60 # Cop supports --auto-correct. # Configuration parameters: AllowInHeredoc. Layout/TrailingWhitespace: Exclude: - 'app/models/distributor_shipping_method.rb' - - 'app/models/spree/calculator/default_tax_decorator.rb' - 'app/models/spree/money_decorator.rb' - 'app/models/spree/product_decorator.rb' - 'app/serializers/api/image_serializer.rb' @@ -967,7 +953,6 @@ Layout/TrailingWhitespace: - 'spec/features/admin/customers_spec.rb' - 'spec/features/admin/variant_overrides_spec.rb' - 'spec/features/consumer/cookies_spec.rb' - - 'spec/helpers/cookies_policy_helper_spec.rb' - 'spec/helpers/enterprises_helper_spec.rb' - 'spec/lib/open_food_network/enterprise_fee_calculator_spec.rb' - 'spec/lib/open_food_network/group_buy_report_spec.rb' @@ -978,7 +963,6 @@ Layout/TrailingWhitespace: - 'spec/serializers/admin/enterprise_serializer_spec.rb' - 'spec/serializers/enterprise_serializer_spec.rb' - 'spec/support/request/menu_helper.rb' - - 'spec/views/json/producers.json.rabl_spec.rb' # Offense count: 1 Lint/AmbiguousOperator: @@ -1026,11 +1010,10 @@ Lint/ScriptPermission: Exclude: - 'Rakefile' -# Offense count: 5 +# Offense count: 3 Lint/ShadowingOuterLocalVariable: Exclude: - 'app/models/model_set.rb' - - 'app/models/spree/product_set.rb' - 'spec/models/model_set_spec.rb' # Offense count: 6 @@ -1110,7 +1093,7 @@ Lint/UselessAccessModifier: - 'lib/open_food_network/reports/bulk_coop_report.rb' - 'spec/lib/open_food_network/reports/report_spec.rb' -# Offense count: 246 +# Offense count: 242 # Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: @@ -1125,7 +1108,6 @@ Lint/Void: - 'spec/controllers/spree/admin/variants_controller_spec.rb' - 'spec/controllers/spree/api/products_controller_spec.rb' - 'spec/controllers/spree/api/variants_controller_spec.rb' - - 'spec/controllers/user_registrations_controller_spec.rb' - 'spec/features/admin/bulk_product_update_spec.rb' - 'spec/features/admin/enterprise_groups_spec.rb' - 'spec/features/admin/enterprises/index_spec.rb' @@ -1166,11 +1148,11 @@ Lint/Void: - 'spec/serializers/enterprise_serializer_spec.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 195 +# Offense count: 192 Metrics/AbcSize: Max: 293 -# Offense count: 1010 +# Offense count: 1039 # Configuration parameters: CountComments, ExcludedMethods. Metrics/BlockLength: Max: 787 @@ -1185,17 +1167,17 @@ Metrics/BlockNesting: Metrics/ClassLength: Max: 331 -# Offense count: 38 +# Offense count: 36 Metrics/CyclomaticComplexity: Max: 23 -# Offense count: 6683 +# Offense count: 2717 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: - Max: 623 + Max: 619 -# Offense count: 163 +# Offense count: 161 # Configuration parameters: CountComments. Metrics/MethodLength: Max: 95 @@ -1210,7 +1192,7 @@ Metrics/ModuleLength: Metrics/ParameterLists: Max: 8 -# Offense count: 30 +# Offense count: 28 Metrics/PerceivedComplexity: Max: 21 @@ -1317,10 +1299,11 @@ Performance/DoubleStartEndWith: Exclude: - 'app/helpers/application_helper.rb' -# Offense count: 4 +# Offense count: 5 # Cop supports --auto-correct. Performance/InefficientHashSearch: Exclude: + - 'app/models/product_import/product_importer.rb' - 'app/models/spree/payment_method_decorator.rb' - 'app/models/spree/preferences/file_configuration.rb' - 'lib/stripe/account_connector.rb' @@ -1357,11 +1340,10 @@ Performance/StringReplacement: - 'app/helpers/spree/admin/navigation_helper_decorator.rb' - 'app/models/spree/preferences/file_configuration.rb' -# Offense count: 5 +# Offense count: 4 # Cop supports --auto-correct. Performance/UnneededSort: Exclude: - - 'app/models/spree/product_decorator.rb' - 'spec/features/admin/order_cycles_spec.rb' # Offense count: 11 @@ -1430,7 +1412,7 @@ Rails/HasAndBelongsToMany: - 'app/models/spree/line_item_decorator.rb' - 'app/models/spree/payment_method_decorator.rb' -# Offense count: 29 +# Offense count: 28 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasManyOrHasOneDependent: @@ -1489,7 +1471,7 @@ Rails/OutputSafety: - 'lib/spree/money_decorator.rb' - 'spec/features/admin/orders_spec.rb' -# Offense count: 7 +# Offense count: 10 # Cop supports --auto-correct. Rails/PluralizationGrammar: Exclude: @@ -1497,6 +1479,7 @@ Rails/PluralizationGrammar: - 'spec/jobs/update_account_invoices_spec.rb' - 'spec/jobs/update_billable_periods_spec.rb' - 'spec/models/order_cycle_spec.rb' + - 'spec/models/spree/product_spec.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -1564,7 +1547,7 @@ Rails/UnknownEnv: Exclude: - 'lib/open_food_network/cached_products_renderer.rb' -# Offense count: 21 +# Offense count: 19 # Cop supports --auto-correct. # Configuration parameters: Include. # Include: app/models/**/*.rb @@ -1578,10 +1561,9 @@ Rails/Validation: - 'app/models/order_cycle.rb' - 'app/models/product_distribution.rb' - 'app/models/spree/product_decorator.rb' - - 'app/models/spree/variant_decorator.rb' - 'app/models/variant_override.rb' -# Offense count: 20 +# Offense count: 18 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: always, conditionals @@ -1596,20 +1578,18 @@ Style/AndOr: - 'app/helpers/spree/admin/navigation_helper_decorator.rb' - 'app/models/spree/adjustment_decorator.rb' - 'app/models/spree/order_decorator.rb' - - 'app/models/spree/product_set.rb' - 'app/views/json/partials/_enterprise.rabl' - 'lib/spree/core/controller_helpers/respond_with_decorator.rb' -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: percent_q, bare_percent Style/BarePercentLiterals: Exclude: - 'spec/features/admin/variants_spec.rb' - - 'spec/support/request/web_helper.rb' -# Offense count: 207 +# Offense count: 212 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: braces, no_braces, context_dependent @@ -1657,6 +1637,7 @@ Style/BracesAroundHashParameters: - 'spec/controllers/spree/api/variants_controller_spec.rb' - 'spec/controllers/spree/orders_controller_spec.rb' - 'spec/controllers/user_confirmations_controller_spec.rb' + - 'spec/controllers/user_registrations_controller_spec.rb' - 'spec/features/admin/accounts_and_billing_settings_spec.rb' - 'spec/features/admin/business_model_configuration_spec.rb' - 'spec/features/admin/order_cycles_spec.rb' @@ -1800,7 +1781,7 @@ Style/CommentedKeyword: Exclude: - 'app/controllers/application_controller.rb' -# Offense count: 4 +# Offense count: 6 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. # SupportedStyles: assign_to_condition, assign_inside_condition @@ -1808,6 +1789,7 @@ Style/ConditionalAssignment: Exclude: - 'app/controllers/checkout_controller.rb' - 'app/controllers/spree/admin/search_controller_decorator.rb' + - 'app/models/spree/calculator/per_item_decorator.rb' - 'app/models/spree/line_item_decorator.rb' - 'spec/lib/open_food_network/order_grouper_spec.rb' @@ -1861,7 +1843,7 @@ Style/FormatStringToken: - 'lib/open_food_network/sales_tax_report.rb' - 'spec/models/enterprise_spec.rb' -# Offense count: 79 +# Offense count: 80 # Configuration parameters: MinBodyLength. Style/GuardClause: Exclude: @@ -1909,7 +1891,7 @@ Style/GuardClause: - 'spec/support/request/distribution_helper.rb' - 'spec/support/request/shop_workflow.rb' -# Offense count: 930 +# Offense count: 924 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys @@ -1964,7 +1946,6 @@ Style/HashSyntax: - 'app/models/spree/payment_decorator.rb' - 'app/models/spree/payment_method_decorator.rb' - 'app/models/spree/product_decorator.rb' - - 'app/models/spree/product_set.rb' - 'app/models/spree/taxon_decorator.rb' - 'app/models/spree/user_decorator.rb' - 'app/overrides/add_distributor_details_js_to_product.rb' @@ -2299,7 +2280,7 @@ Style/RedundantReturn: - 'app/models/spree/classification_decorator.rb' - 'app/serializers/api/admin/enterprise_serializer.rb' -# Offense count: 98 +# Offense count: 96 # Cop supports --auto-correct. Style/RedundantSelf: Exclude: @@ -2355,7 +2336,56 @@ Style/RescueModifier: - 'app/controllers/spree/admin/orders_controller_decorator.rb' - 'lib/tasks/data.rake' -# Offense count: 5 +# Offense count: 268 +Style/Send: + Exclude: + - 'spec/controllers/admin/subscriptions_controller_spec.rb' + - 'spec/controllers/checkout_controller_spec.rb' + - 'spec/controllers/shop_controller_spec.rb' + - 'spec/controllers/spree/admin/base_controller_spec.rb' + - 'spec/controllers/spree/orders_controller_spec.rb' + - 'spec/helpers/order_cycles_helper_spec.rb' + - 'spec/jobs/refresh_products_cache_job_spec.rb' + - 'spec/jobs/subscription_confirm_job_spec.rb' + - 'spec/jobs/subscription_placement_job_spec.rb' + - 'spec/lib/open_food_network/address_finder_spec.rb' + - 'spec/lib/open_food_network/enterprise_fee_applicator_spec.rb' + - 'spec/lib/open_food_network/enterprise_fee_calculator_spec.rb' + - 'spec/lib/open_food_network/lettuce_share_report_spec.rb' + - 'spec/lib/open_food_network/option_value_namer_spec.rb' + - 'spec/lib/open_food_network/order_cycle_form_applicator_spec.rb' + - 'spec/lib/open_food_network/permissions_spec.rb' + - 'spec/lib/open_food_network/products_and_inventory_report_spec.rb' + - 'spec/lib/open_food_network/products_cache_spec.rb' + - 'spec/lib/open_food_network/products_renderer_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/subscription_summarizer_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' + - 'spec/models/enterprise_spec.rb' + - 'spec/models/exchange_spec.rb' + - 'spec/models/order_cycle_spec.rb' + - 'spec/models/product_distribution_spec.rb' + - 'spec/models/spree/gateway/stripe_connect_spec.rb' + - 'spec/models/spree/line_item_spec.rb' + - 'spec/models/spree/order_spec.rb' + - 'spec/models/spree/payment_spec.rb' + - 'spec/models/spree/preference_spec.rb' + - 'spec/models/spree/tax_rate_spec.rb' + - 'spec/models/tag_rule/discount_order_spec.rb' + - 'spec/models/tag_rule/filter_order_cycles_spec.rb' + - 'spec/models/tag_rule/filter_payment_methods_spec.rb' + - 'spec/models/tag_rule/filter_products_spec.rb' + - 'spec/models/tag_rule/filter_shipping_methods_spec.rb' + - 'spec/services/cart_service_spec.rb' + - 'spec/spec_helper.rb' + - 'spec/support/localized_number_helper.rb' + - 'spec/support/matchers/delegate_matchers.rb' + - 'spec/support/request/web_helper.rb' + +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: require_parentheses, require_no_parentheses @@ -2464,7 +2494,7 @@ Style/UnneededInterpolation: - 'spec/lib/open_food_network/order_cycle_form_applicator_spec.rb' - 'spec/support/request/ui_component_helper.rb' -# Offense count: 23 +# Offense count: 22 # Cop supports --auto-correct. Style/UnneededPercentQ: Exclude: @@ -2490,10 +2520,3 @@ Style/UnneededPercentQ: - 'spec/features/admin/variants_spec.rb' - 'spec/features/consumer/account_spec.rb' - 'spec/features/consumer/producers_spec.rb' - - 'spec/support/request/web_helper.rb' - -# Offense count: 6683 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Metrics/LineLength: - Max: 623