Last active
December 18, 2015 17:28
-
-
Save msaffitz/5818291 to your computer and use it in GitHub Desktop.
Fix custom data for Mikandi
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
App.find('4f53c660fab0b800010000a5').conversations.where(record_id: {'$exists' => 1}).each do |c| | |
record = Record.find(c[:record_id]) | |
next if record.data.blank? || c.person.blank? | |
c.person.custom_data ||= {} | |
c.person.custom_data.reverse_merge!(record.data) | |
c.person.save | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment