Class: ActiveRecord::Associations::ClassMethods::JoinDependency

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_arel/selectable_includes.rb

Instance Method Summary collapse

Instance Method Details

#instantiate_with_selectable_includes(rows) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/fake_arel/selectable_includes.rb', line 19

def instantiate_with_selectable_includes(rows)
  unless rows.empty?
    keys_from_select = rows.first.keys.reject {|k| k =~ /\At\d+_r\d+/}
    join_base.extra_columns = keys_from_select
  end
  instantiate_without_selectable_includes(rows)
end