Autoformat code with rubocop

This commit is contained in:
Nelson Jovel 2022-03-04 15:29:54 +01:00
parent 68dde8a6ef
commit ed7a3b8a3d
43 changed files with 112 additions and 114 deletions

View file

@ -1,6 +1,6 @@
class CategoriesController < SqmApplicationController
def show
@categories = Category.sorted.map { |category| CategoryPresenter.new(category: category) }
@categories = Category.sorted.map { |category| CategoryPresenter.new(category:) }
@category = CategoryPresenter.new(category: Category.find_by_slug(params[:id]))
end

View file

@ -3,6 +3,6 @@ class HomeController < ApplicationController
@districts = District.all.order(:name)
@schools = School.all.includes([:district]).order(:name)
@categories = Category.sorted.map { |category| CategoryPresenter.new(category: category) }
@categories = Category.sorted.map { |category| CategoryPresenter.new(category:) }
end
end

View file

@ -1,7 +1,7 @@
class OverviewController < SqmApplicationController
def index
@variance_chart_row_presenters = Measure.all.map(&method(:presenter_for_measure))
@category_presenters = Category.sorted.map { |category| CategoryPresenter.new(category: category) }
@category_presenters = Category.sorted.map { |category| CategoryPresenter.new(category:) }
end
private
@ -9,6 +9,6 @@ class OverviewController < SqmApplicationController
def presenter_for_measure(measure)
score = measure.score(school: @school, academic_year: @academic_year)
VarianceChartRowPresenter.new(measure: measure, score: score)
VarianceChartRowPresenter.new(measure:, score:)
end
end