Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/github/sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,7 @@ def models(klass)
return @models if defined? @models
return [] if frozen?

# Use select_all to retrieve hashes for each row instead of arrays of values.
@models = connection.
select_all(query, "#{klass.name} Load via #{self.class.name}").
map { |record| klass.send :instantiate, record }
@models = klass.find_by_sql(query)

retrieve_found_row_count
freeze
Expand Down