Rename rake task file to 'dupes'

This commit is contained in:
Alex Basson 2021-10-20 08:47:46 -04:00
parent fe1e314c89
commit 4e1fe3f4cf

View file

@ -21,7 +21,7 @@ namespace :dupes do
end end
task dedup_schools: :environment do task dedup_schools: :environment do
School.all.order(:district_id, :name, :created_at).each do |school| School.all.each do |school|
schools = School.where(name: school.name, district: school.district).order(:created_at) schools = School.where(name: school.name, district: school.district).order(:created_at)
if schools.length > 1 if schools.length > 1
school_to_keep = schools.first school_to_keep = schools.first