mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-13 09:20:38 -07:00
implement suggestions from static code analysis tools
This commit is contained in:
parent
bb5f668497
commit
e89358dacc
21 changed files with 252 additions and 121 deletions
|
|
@ -1,10 +1,24 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CategoriesController < SqmApplicationController
|
||||
before_action :response_rate_timestamp, only: [:index]
|
||||
helper GaugeHelper
|
||||
|
||||
def show
|
||||
@categories = Category.sorted.map { |category| CategoryPresenter.new(category:) }
|
||||
|
||||
@category = CategoryPresenter.new(category: Category.find_by_slug(params[:id]))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def response_rate_timestamp
|
||||
@response_rate_timestamp = begin
|
||||
rate = ResponseRate.where(school: @school,
|
||||
academic_year: @academic_year).order(updated_at: :DESC).first || Today.new
|
||||
|
||||
rate.updated_at
|
||||
end
|
||||
@response_rate_timestamp
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue