Skip to content

Instantly share code, notes, and snippets.

@geraldodev
Created April 16, 2013 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geraldodev/5392638 to your computer and use it in GitHub Desktop.
Save geraldodev/5392638 to your computer and use it in GitHub Desktop.
sequel transaction beauty
DB.transaction do
rows_affected = DB[:cod_pro].returning.where({:CD_COD_PRO => cd_cod_pro}).update({:DS_CODIGO_COBRANCA => cd_unimed,
:DS_NOME_COBRANCA => descricao_unimed})
puts "atualizou cd_cod_pro #{cd_cod_pro} #{ary.inspect} "
raise "sql update cod_pro errado " if rows_affected != 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment