mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
adding joins method to Table
This commit is contained in:
parent
719eacfc81
commit
90881c5841
2 changed files with 12 additions and 0 deletions
|
@ -26,6 +26,10 @@ module Arel
|
||||||
SelectManager.new(@engine).from(self)
|
SelectManager.new(@engine).from(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def joins manager
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
def join relation
|
def join relation
|
||||||
sm = SelectManager.new(@engine)
|
sm = SelectManager.new(@engine)
|
||||||
case relation
|
case relation
|
||||||
|
|
|
@ -6,6 +6,14 @@ module Arel
|
||||||
@relation = Table.new(:users)
|
@relation = Table.new(:users)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'backwards compat' do
|
||||||
|
describe 'joins' do
|
||||||
|
it 'returns nil' do
|
||||||
|
check @relation.joins(nil).should == nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe 'alias' do
|
describe 'alias' do
|
||||||
it 'should create a node that proxies to a table' do
|
it 'should create a node that proxies to a table' do
|
||||||
check @relation.aliases.should == []
|
check @relation.aliases.should == []
|
||||||
|
|
Loading…
Reference in a new issue