Skip to content

Commit

Permalink
No need to use inject here.
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information
miloops authored and spastorino committed Sep 22, 2010
1 parent ea35ccf commit 2da809d
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -276,7 +276,7 @@ def select_rows(sql, name = nil)
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

Expand Down Expand Up @@ -358,10 +358,10 @@ def structure_dump #:nodoc:
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:
Expand Down Expand Up @@ -620,7 +620,7 @@ def select(sql, name = nil)
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

Expand Down

0 comments on commit 2da809d

Please sign in to comment.