Skip to content

Instantly share code, notes, and snippets.

@lpradovera
Created July 11, 2011 10:04
Show Gist options
  • Save lpradovera/1075636 to your computer and use it in GitHub Desktop.
Save lpradovera/1075636 to your computer and use it in GitHub Desktop.
def self.exec_sql(sql)
18 sql = ActiveRecord::Base.connection();
19 sql.execute "SET autocommit=0";
20 sql.begin_db_transaction
21 sql.execute(sql)
22 sql.commit_db_transaction
23 end#exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment