aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_relation/relations/relation.rb
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-11 15:53:45 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-11 15:53:45 -0700
commit3967bd524da7b3c0b985c57670ceb7f5d48a0f1b (patch)
tree8e342a0ad2f6b27948731ad1c1433bcfb8aa2f29 /lib/active_relation/relations/relation.rb
parenteee3a766160cd32a4d9b5e1352858597005c9cee (diff)
downloadrails-3967bd524da7b3c0b985c57670ceb7f5d48a0f1b.tar.gz
rails-3967bd524da7b3c0b985c57670ceb7f5d48a0f1b.tar.bz2
rails-3967bd524da7b3c0b985c57670ceb7f5d48a0f1b.zip
string passthrough for joins
Diffstat (limited to 'lib/active_relation/relations/relation.rb')
-rw-r--r--lib/active_relation/relations/relation.rb7
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)