Module: ActiveRecord::QueryMethods

Defined in:
lib/monkey_patch_activerecord.rb

Overview

A patch to QueryMethods to change default behavior of select to use the Relation’s Arel::Table.

Instance Method Summary collapse

Instance Method Details

#build_select(arel, selects) ⇒ Object



82
83
84
85
86
87
88
89
# File 'lib/monkey_patch_activerecord.rb', line 82

def build_select(arel, selects)
  unless selects.empty?
    @implicit_readonly = false
    arel.project(*selects)
  else
    arel.project(table[Arel.star])
  end
end