Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

No need to use inject here.

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
commit 2da809da37c51801f1f97ef4e83b1db13753898d 1 parent ea35ccf
@miloops miloops authored spastorino committed
View
10 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -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
@@ -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:
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.