Created
March 22, 2018 22:08
-
-
Save cfitz/0a2347ee24f13bf9bba2282f6e45fc36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# plugins/local/backend/model/fix_sort_names.rb | |
[ NameCorporateEntity, NameFamily, NamePerson, NameSoftware].each do |klass| | |
$stderr.puts "Updating ... #{klass}" | |
klass.all.each do |obj| | |
# get the jsonmodel | |
json = klass.to_jsonmodel(obj) | |
# now "update" the record with a copy of its json | |
obj.update_from_json(json) | |
# refresh the object and split it out... | |
obj.refresh | |
$stderr.puts "#{obj.id} ==> #{obj.sort_name}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment