Method: Arel::Table#join

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

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



42
43
44
45
46
47
48
49
50
51
52
# File 'activerecord/lib/arel/table.rb', line 42

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