Skip to content

Instantly share code, notes, and snippets.

@nilbus
Last active January 9, 2016 02:35
Show Gist options
  • Save nilbus/c153c09e2c7d72d0ca07 to your computer and use it in GitHub Desktop.
Save nilbus/c153c09e2c7d72d0ca07 to your computer and use it in GitHub Desktop.
tracking = DateTime.strptime(row['tracking'], '%Y%m%d%H%M%S')
Correspondence.where(
tracking: tracking,
sender: row['remetente'],
receiver: row['destinatario']).first_or_create(
tracking: tracking,
sender: row['remetente'],
receiver: row['destinatario'],
department: row['depto'],
bay: row['baia'],
floor: row['andar'],
note: row['obs'],
mail: row['correio'],
carrier: row['transp'],
ts_print: row['ts_impressao'],
ts_attempt1: row['ts_tt1'],
ts_attempt2: row['ts_tt2'],
ts_attempt3: row['ts_tt3'],
ts_signature: row['ts_assinatura'],
delivery_status: row['tipo']
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment