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:
parent
dfc66f4421
commit
8f6752ef6e
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue