diff --git a/app/controllers/admin/order_cycles_controller.rb b/app/controllers/admin/order_cycles_controller.rb index 2f2597547c..5f877e9784 100644 --- a/app/controllers/admin/order_cycles_controller.rb +++ b/app/controllers/admin/order_cycles_controller.rb @@ -107,6 +107,7 @@ module Admin protected + def collection return Enterprise.where("1=0") unless json_request? ocs = if params[:as] == "distributor" @@ -130,6 +131,7 @@ module Admin end private + def load_data_for_index if json_request? # Split ransack params into all those that currently exist and new ones to limit returned ocs to recent or undated diff --git a/app/controllers/spree/admin/shipping_methods_controller_decorator.rb b/app/controllers/spree/admin/shipping_methods_controller_decorator.rb index e6b7667f9f..9b2b03cf5e 100644 --- a/app/controllers/spree/admin/shipping_methods_controller_decorator.rb +++ b/app/controllers/spree/admin/shipping_methods_controller_decorator.rb @@ -44,6 +44,7 @@ module Spree end private + def load_hubs @hubs = Enterprise.managed_by(spree_current_user).is_distributor.sort_by!{ |d| [(@shipping_method.has_distributor? d) ? 0 : 1, d.name] } end diff --git a/app/helpers/angular_form_builder.rb b/app/helpers/angular_form_builder.rb index 4dff1f92e1..1f1ed29550 100644 --- a/app/helpers/angular_form_builder.rb +++ b/app/helpers/angular_form_builder.rb @@ -36,6 +36,7 @@ class AngularFormBuilder < ActionView::Helpers::FormBuilder end private + def angular_name(method) "#{@object_name}[#{@fields_for_record_name}_attributes][{{ $index }}][#{method}]" end diff --git a/script/rubocop_autocorrect b/script/rubocop_autocorrect index bacbb97dcc..1ca248ddfa 100755 --- a/script/rubocop_autocorrect +++ b/script/rubocop_autocorrect @@ -1,6 +1,8 @@ #!/bin/sh -$COP=$1 +set -e + +COP="$1" bundle exec rubocop -a --only "$COP" git add -A diff --git a/spec/helpers/products_helper_spec.rb b/spec/helpers/products_helper_spec.rb index 22fd7f4606..812b053fb1 100644 --- a/spec/helpers/products_helper_spec.rb +++ b/spec/helpers/products_helper_spec.rb @@ -14,6 +14,7 @@ module Spree end private + def make_variant_stub(product_price, variant_price) product = double(:product, price: product_price) variant = double(:variant, product: product, price: variant_price) diff --git a/spec/support/request/web_helper.rb b/spec/support/request/web_helper.rb index e95d02ede7..5e1712b131 100644 --- a/spec/support/request/web_helper.rb +++ b/spec/support/request/web_helper.rb @@ -199,6 +199,7 @@ module WebHelper end private + def wait_for_ajax wait_until { page.evaluate_script("$.active") == 0 } end