Skip to content
Browse files

Add SelectManager#source method to get the source of the ctx

  • Loading branch information...
1 parent 88c91f7 commit 34bd53ba015b8f9bca77172784e62994487eef9b @jonleighton jonleighton committed Aug 11, 2011
Showing with 12 additions and 0 deletions.
  1. +4 −0 lib/arel/select_manager.rb
  2. +8 −0 test/test_select_manager.rb
View
4 lib/arel/select_manager.rb
@@ -224,6 +224,10 @@ def join_sources
@ctx.source.right
end
+ def source
+ @ctx.source
+ end
+
def joins manager
if $VERBOSE
warn "joins is deprecated and will be removed in 3.0.0"
View
8 test/test_select_manager.rb
@@ -956,5 +956,13 @@ def test_join_sources
manager.to_sql.must_be_like 'SELECT "users"."id" FROM "users"'
end
end
+
+ describe 'source' do
+ it 'returns the join source of the select core' do
+ table = Table.new :users
+ manager = Arel::SelectManager.new Table.engine
+ manager.source.must_equal manager.ast.cores.last.source
+ end
+ end
end
end

0 comments on commit 34bd53b

Please sign in to comment.
Something went wrong with that request. Please try again.