mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
fixing bug with merge_into
This commit is contained in:
parent
5902c2787f
commit
db525ed2d3
1 changed files with 1 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ class School < ApplicationRecord
|
|||
base_categories = Category.joins(:questions).to_a.flatten.uniq
|
||||
base_categories.each do |category|
|
||||
SchoolCategory.for(school, category).each do |school_category|
|
||||
year = school_category.year
|
||||
dup_school_categories = SchoolCategory.for(school, category).in(year)
|
||||
if dup_school_categories.count > 1
|
||||
dup_school_categories.each { |dsc| dsc.destroy unless dsc.id == school_category.id }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue