0
4

1 回答 1

0

Entering the following commands in the rails console seemed to work for me:

dups = DictionaryEntry.count(:id, :group => :simplified, :having => 'count(id) > 1')
dups.each do |d|
twins = DictionaryEntry.find_all_by_simplified(d[0])
if twins[0].pinyin == twins[1].pinyin
twins[1].definition = twins[1].definition + "/" + twins[0].definition
twins[1].save
twins[0].destroy
end
end

I had to run it a few times.

于 2013-01-03T13:31:14.377 回答