1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Defines the return type of select / select_all method.

This commit is contained in:
kennyj 2013-07-16 23:48:18 +09:00
parent 68bbbd470d
commit 42f4ec6265
3 changed files with 8 additions and 6 deletions

View file

@ -18,8 +18,7 @@ module ActiveRecord
end
end
# Returns an array of record hashes with the column names as keys and
# column values as values.
# Returns an ActiveRecord::Result instance.
def select_all(arel, name = nil, binds = [])
select(to_sql(arel, binds), name, binds)
end
@ -355,8 +354,7 @@ module ActiveRecord
subselect
end
# Returns an array of record hashes with the column names as keys and
# column values as values.
# Returns an ActiveRecord::Result instance.
def select(sql, name = nil, binds = [])
end
undef_method :select

View file

@ -229,8 +229,7 @@ module ActiveRecord
alias exec_without_stmt exec_query
# Returns an array of record hashes with the column names as keys and
# column values as values.
# Returns an ActiveRecord::Result instance.
def select(sql, name = nil, binds = [])
exec_query(sql, name)
end

View file

@ -173,6 +173,11 @@ module ActiveRecord
end
end
end
def test_select_all_always_return_activerecord_result
result = @connection.select_all "SELECT * FROM posts"
assert result.is_a?(ActiveRecord::Result)
end
end
class AdapterTestWithoutTransaction < ActiveRecord::TestCase