diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-12 16:22:38 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-26 13:44:08 -0700 |
commit | 76d08057860d61cf16893bbfecbc7c7ccec74386 (patch) | |
tree | 70ff764b4f7a1649879aa382bc332de886453136 | |
parent | 77d548a6d339be894c5369c7c0ef78af8a3b5af3 (diff) | |
download | rails-76d08057860d61cf16893bbfecbc7c7ccec74386.tar.gz rails-76d08057860d61cf16893bbfecbc7c7ccec74386.tar.bz2 rails-76d08057860d61cf16893bbfecbc7c7ccec74386.zip |
stop calling execute directly on the database connection
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 8ae9d2afe4..0ea45dd61d 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -387,11 +387,11 @@ module ActiveRecord 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 |