aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/table.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/table.rb')
-rw-r--r--lib/arel/table.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/arel/table.rb b/lib/arel/table.rb
index 02ece7ff07..b3a1a105d8 100644
--- a/lib/arel/table.rb
+++ b/lib/arel/table.rb
@@ -27,7 +27,14 @@ module Arel
end
def join relation
- SelectManager.new(@engine).from(Nodes::InnerJoin.new(self, relation, nil))
+ sm = SelectManager.new(@engine)
+ case relation
+ when String, Nodes::SqlLiteral
+ raise if relation.blank?
+ sm.from Nodes::StringJoin.new(self, relation)
+ else
+ sm.from Nodes::InnerJoin.new(self, relation, nil)
+ end
end
def where condition