diff --git a/lib/open_food_network/order_cycle_permissions.rb b/lib/open_food_network/order_cycle_permissions.rb index 8f3ede515d..4635322482 100644 --- a/lib/open_food_network/order_cycle_permissions.rb +++ b/lib/open_food_network/order_cycle_permissions.rb @@ -25,7 +25,7 @@ module OpenFoodNetwork if @coordinator.sells == "any" # If the coordinator sells any, relationships come into play related_enterprises_granting(:add_to_order_cycle, - to: [@coordinator.id]).each do |enterprise_id| + to: [@coordinator.id]).each do |enterprise_id| coordinator_permitted_ids << enterprise_id end @@ -125,7 +125,7 @@ module OpenFoodNetwork # Find the variants that a user can POTENTIALLY see within incoming exchanges def visible_variants_for_incoming_exchanges_from(producer) if @order_cycle && - (user_manages_coordinator_or(producer) || user_is_permitted_add_to_oc_by(producer)) + (user_manages_coordinator_or(producer) || user_is_permitted_add_to_oc_by(producer)) all_variants_supplied_by(producer) else no_variants @@ -212,8 +212,8 @@ module OpenFoodNetwork # Variants produced by MY PRODUCERS that are in this OC, # where my producer has granted P-OC to the hub granting_producer_ids = related_enterprises_granting(:add_to_order_cycle, - to: [hub.id], - scope: granted_producers) + to: [hub.id], + scope: granted_producers) permitted_variants = variants_from_suppliers(granting_producer_ids) Spree::Variant.where(id: permitted_variants) diff --git a/lib/reporting/report_object_template.rb b/lib/reporting/report_object_template.rb index e9d6e2bbb5..fff2559934 100644 --- a/lib/reporting/report_object_template.rb +++ b/lib/reporting/report_object_template.rb @@ -4,7 +4,6 @@ # The result from those models module Reporting class ReportObjectTemplate < ReportTemplate - def table_headers raise NotImplementedError end diff --git a/lib/reporting/report_renderer.rb b/lib/reporting/report_renderer.rb index 998b5529d1..84e19254ae 100644 --- a/lib/reporting/report_renderer.rb +++ b/lib/reporting/report_renderer.rb @@ -19,7 +19,7 @@ module Reporting def as_json table_rows.map do |row| result = {} - table_headers.zip(row) { |a,b| result[a.to_sym] = b } + table_headers.zip(row) { |a, b| result[a.to_sym] = b } result end.as_json end diff --git a/lib/reporting/reports/users_and_enterprises/users_and_enterprises_report.rb b/lib/reporting/reports/users_and_enterprises/users_and_enterprises_report.rb index dade08a64b..26b4d37822 100644 --- a/lib/reporting/reports/users_and_enterprises/users_and_enterprises_report.rb +++ b/lib/reporting/reports/users_and_enterprises/users_and_enterprises_report.rb @@ -4,7 +4,6 @@ module Reporting module Reports module UsersAndEnterprises class UsersAndEnterprisesReport < ReportObjectTemplate - def initialize(user, params = {}) super(user, params) diff --git a/spec/controllers/admin/reports_controller_spec.rb b/spec/controllers/admin/reports_controller_spec.rb index 3ad47e99d7..00d1031da6 100644 --- a/spec/controllers/admin/reports_controller_spec.rb +++ b/spec/controllers/admin/reports_controller_spec.rb @@ -21,12 +21,14 @@ describe Admin::ReportsController, type: :controller do # Given two order cycles with both distributors let(:ocA) { - create(:simple_order_cycle, coordinator: coordinator1, distributors: [distributor1, distributor2], + create(:simple_order_cycle, coordinator: coordinator1, + distributors: [distributor1, distributor2], suppliers: [supplier1, supplier2, supplier3], variants: [product1.master, product3.master]) } let(:ocB) { - create(:simple_order_cycle, coordinator: coordinator2, distributors: [distributor1, distributor2], + create(:simple_order_cycle, coordinator: coordinator2, + distributors: [distributor1, distributor2], suppliers: [supplier1, supplier2, supplier3], variants: [product2.master]) } @@ -157,7 +159,8 @@ describe Admin::ReportsController, type: :controller do spree_get :index report_types = assigns(:reports).keys - expect(report_types).to include :orders_and_fulfillment, :products_and_inventory, :packing # and others + expect(report_types).to include :orders_and_fulfillment, + :products_and_inventory, :packing # and others expect(report_types).to_not include :sales_tax end end diff --git a/spec/lib/reports/xero_invoices_report_spec.rb b/spec/lib/reports/xero_invoices_report_spec.rb index 4d63acdad4..3348abb510 100644 --- a/spec/lib/reports/xero_invoices_report_spec.rb +++ b/spec/lib/reports/xero_invoices_report_spec.rb @@ -19,10 +19,10 @@ module Reporting around { |example| Timecop.travel(Time.zone.local(2015, 5, 5, 14, 0, 0)) { example.run } } it "uses defaults when blank params are passed" do - expect(report.instance_variable_get(:@params)).to eq( invoice_date: Date.civil(2015, 5, 5), - due_date: Date.civil(2015, 6, 5), - account_code: 'food sales', - report_subtype: 'summary' ) + expect(report.instance_variable_get(:@params)).to eq(invoice_date: Date.civil(2015, 5, 5), + due_date: Date.civil(2015, 6, 5), + account_code: 'food sales', + report_subtype: 'summary' ) end end