Module: ActiveRecord::MTI::QueryMethods
- Defined in:
- lib/active_record/mti/query_methods.rb
Instance Method Summary collapse
Instance Method Details
#build_arel ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/active_record/mti/query_methods.rb', line 5 def build_arel @select_by_tableoid = [select_values.delete(:tableoid), tableoid?(klass)].compact.first @group_by_tableoid = group_values.delete(:tableoid) super.tap do |arel| if @group_by_tableoid || (@select_by_tableoid && group_values.any?) arel.group(tableoid_group(@klass)) end end end |
#build_select(*args) ⇒ Object
16 17 18 19 20 |
# File 'lib/active_record/mti/query_methods.rb', line 16 def build_select(*args) super.tap do |arel| arel.project(tableoid_project(@klass)) if (@group_by_tableoid || @select_by_tableoid) end end |