Skip to content

Instantly share code, notes, and snippets.

@msaffitz
Last active December 18, 2015 17:28
Show Gist options
  • Save msaffitz/5818291 to your computer and use it in GitHub Desktop.
Save msaffitz/5818291 to your computer and use it in GitHub Desktop.
Fix custom data for Mikandi
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