1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

get from values out of the select manager

This commit is contained in:
Aaron Patterson 2010-12-07 15:05:51 -08:00
parent dfc66f4421
commit 8f6752ef6e
2 changed files with 9 additions and 0 deletions

View file

@ -79,6 +79,10 @@ module Arel
self
end
def froms
@ast.cores.map { |x| x.from }.compact
end
def join relation, klass = Nodes::InnerJoin
return self unless relation

View file

@ -277,6 +277,11 @@ module Arel
end
end
it 'should hand back froms' do
relation = Arel::SelectManager.new Table.engine
assert_equal [], relation.froms
end
it 'should create join nodes' do
relation = Arel::SelectManager.new Table.engine
join = relation.create_join 'foo', 'bar', 'baz'