diff options
Diffstat (limited to 'lib/active_relation/relations/relation.rb')
-rw-r--r-- | lib/active_relation/relations/relation.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/active_relation/relations/relation.rb b/lib/active_relation/relations/relation.rb index eebfd48e30..1b80494cd7 100644 --- a/lib/active_relation/relations/relation.rb +++ b/lib/active_relation/relations/relation.rb @@ -19,7 +19,12 @@ module ActiveRelation module Operations def join(other) - JoinOperation.new("INNER JOIN", self, other) + case other + when String + Join.new(other, self) + when Relation + JoinOperation.new("INNER JOIN", self, other) + end end def outer_join(other) |