Skip to content

Commit

Permalink
stop calling execute directly on the database connection
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Oct 26, 2010
1 parent 77d548a commit 76d0805
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,11 @@ def copy_table_contents(from, to, columns, rename = {}) #:nodoc:
quoted_columns = columns.map { |col| quote_column_name(col) } * ','

quoted_to = quote_table_name(to)
@connection.execute "SELECT * FROM #{quote_table_name(from)}" do |row|
exec("SELECT * FROM #{quote_table_name(from)}").each do |row|
sql = "INSERT INTO #{quoted_to} (#{quoted_columns}) VALUES ("
sql << columns.map {|col| quote row[column_mappings[col]]} * ', '
sql << ')'
@connection.execute sql
exec sql
end
end

Expand Down

0 comments on commit 76d0805

Please sign in to comment.