No need to use inject here.

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Emilio Tagua 2010-09-22 11:22:21 -03:00 committed by Santiago Pastorino
parent ea35ccfe20
commit 2da809da37
1 changed files with 5 additions and 5 deletions

View File

@ -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