diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-22 11:22:21 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-09-22 18:08:02 -0300 |
commit | 2da809da37c51801f1f97ef4e83b1db13753898d (patch) | |
tree | a78bd158225ec2df5e9a0b9a3b98c61d7115fab5 /activerecord | |
parent | ea35ccfe2014aff208601b98442ff03fa76269a9 (diff) | |
download | rails-2da809da37c51801f1f97ef4e83b1db13753898d.tar.gz rails-2da809da37c51801f1f97ef4e83b1db13753898d.tar.bz2 rails-2da809da37c51801f1f97ef4e83b1db13753898d.zip |
No need to use inject here.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index d645376cb2..e7f7b37b27 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -276,7 +276,7 @@ module ActiveRecord rows = [] result.each { |row| rows << row } result.free - @connection.more_results && @connection.next_result # invoking stored procedures with CLIENT_MULTI_RESULTS requires this to tidy up else connection will be dropped + @connection.more_results && @connection.next_result # invoking stored procedures with CLIENT_MULTI_RESULTS requires this to tidy up else connection will be dropped rows end @@ -358,10 +358,10 @@ module ActiveRecord sql = "SHOW TABLES" end - select_all(sql).inject("") do |structure, table| + select_all(sql).map do |table| table.delete('Table_type') - structure += select_one("SHOW CREATE TABLE #{quote_table_name(table.to_a.first.last)}")["Create Table"] + ";\n\n" - end + select_one("SHOW CREATE TABLE #{quote_table_name(table.to_a.first.last)}")["Create Table"] + ";\n\n" + end.join("") end def recreate_database(name, options = {}) #:nodoc: @@ -620,7 +620,7 @@ module ActiveRecord rows = [] result.each_hash { |row| rows << row } result.free - @connection.more_results && @connection.next_result # invoking stored procedures with CLIENT_MULTI_RESULTS requires this to tidy up else connection will be dropped + @connection.more_results && @connection.next_result # invoking stored procedures with CLIENT_MULTI_RESULTS requires this to tidy up else connection will be dropped rows end |