Created
April 16, 2013 01:22
-
-
Save geraldodev/5392638 to your computer and use it in GitHub Desktop.
sequel transaction beauty
This file contains hidden or 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
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