the AR adapter's #select_rows method should be returning an array of arrays (thanks to r-stu31 for the patch)

This commit is contained in:
Brian Lopez 2010-07-08 09:18:58 -07:00
parent a265d36571
commit 39b4776a67
1 changed files with 2 additions and 3 deletions

View File

@ -256,12 +256,11 @@ module ActiveRecord
# DATABASE STATEMENTS ======================================
def select_values(sql, name = nil)
result = select_rows(sql, name)
result.map { |row| row.values.first }
select(sql, name).map { |row| row.values.first }
end
def select_rows(sql, name = nil)
select(sql, name)
select(sql, name).map { |row| row.values }
end
# Executes a SQL query and returns a MySQL::Result object. Note that you have to free the Result object after you're done using it.