app/models/management_priority.rb
Method for_schools
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.for_schools(schools)
query = <<-SQL.squish
SELECT a.school_id, a.id, cv.alert_type_rating_id, vars.average_one_year_saving_£, vars.one_year_saving_co2, vars.one_year_saving_kwh
FROM management_priorities mp
INNER JOIN alert_type_rating_content_versions cv ON mp.alert_type_rating_content_version_id = cv.id