Fix basic rubocop issues in newly added controllers

This commit is contained in:
luisramos0
2019-09-17 15:56:53 +01:00
parent ffde0307e2
commit 822a17f732
3 changed files with 25 additions and 27 deletions

View File

@@ -1,11 +1,9 @@
module Spree
module Admin
class CountriesController < ResourceController
def collection
super.order(:name)
end
def collection
super.order(:name)
end
end
end
end

View File

@@ -7,23 +7,23 @@ module Spree
def index
respond_with(@collection) do |format|
format.html
format.js { render :partial => 'state_list' }
format.js { render partial: 'state_list' }
end
end
protected
def location_after_save
admin_country_states_url(@country)
end
def location_after_save
admin_country_states_url(@country)
end
def collection
super.order(:name)
end
def collection
super.order(:name)
end
def load_data
@countries = Country.order(:name)
end
def load_data
@countries = Country.order(:name)
end
end
end
end

View File

@@ -1,7 +1,7 @@
module Spree
module Admin
class ZonesController < ResourceController
before_filter :load_data, :except => [:index]
before_filter :load_data, except: [:index]
def new
@zone.zone_members.build
@@ -9,18 +9,18 @@ module Spree
protected
def collection
params[:q] ||= {}
params[:q][:s] ||= "ascend_by_name"
@search = super.ransack(params[:q])
@zones = @search.result.page(params[:page]).per(Spree::Config[:orders_per_page])
end
def collection
params[:q] ||= {}
params[:q][:s] ||= "ascend_by_name"
@search = super.ransack(params[:q])
@zones = @search.result.page(params[:page]).per(Spree::Config[:orders_per_page])
end
def load_data
@countries = Country.order(:name)
@states = State.order(:name)
@zones = Zone.order(:name)
end
def load_data
@countries = Country.order(:name)
@states = State.order(:name)
@zones = Zone.order(:name)
end
end
end
end