BathHacked/energy-sparks

View on GitHub
app/controllers/concerns/scoring.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Scoring
  extend ActiveSupport::Concern

  def setup_scores_and_years(scorable)
    @current_year = scorable.this_academic_year
    @previous_year = scorable.previous_academic_year
    @academic_year = if params[:previous_year]
                       @previous_year
                     else
                       @current_year
                     end
    @scored_schools = scorable.scored_schools(academic_year: @academic_year)
  end
end