ensure hash_results is an array on rails 4

Rails 4 changes the return type of select_all from Array to
ActiveRecord::Result
This commit is contained in:
Charlie Somerville 2017-09-28 17:20:32 +02:00
Родитель db1f986607
Коммит b0772a1cfa
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -297,7 +297,7 @@ module GitHub
when /\ASELECT/i
# Why not execute or select_rows? Because select_all hits the query cache.
@hash_results = connection.select_all(query, "#{self.class.name} Select")
@hash_results = connection.select_all(query, "#{self.class.name} Select").to_ary
@results = @hash_results.map(&:values)
else