Method: Arel::Table#join

Defined in:
activerecord/lib/arel/table.rb

#join(relation, klass = Nodes::InnerJoin) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
# File 'activerecord/lib/arel/table.rb', line 38

def join(relation, klass = Nodes::InnerJoin)
  return from unless relation

  case relation
  when String, Nodes::SqlLiteral
    raise EmptyJoinError if relation.empty?
    klass = Nodes::StringJoin
  end

  from.join(relation, klass)
end