Rails rake task, limpar banco de dados, remover duplicatas em múltiplas colunas
# lib/tasks/people.rb task cleanup: :environment do # find all models and group them on keys which should be common grouped_by_first_last_name = Person.all.group_by{|model| [model.fname, model.lname] } grouped_by_email = Person.all.group_by{|model| [model.email] } …
Continuar lendo