Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

feature: add Arel::SelectManager#projections method #141

Merged
merged 1 commit into from

2 participants

Suraj N. Kurapati Aaron Patterson
Suraj N. Kurapati

This commit fixes issue #138. :cake:

Aaron Patterson tenderlove merged commit de7e7c8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 21, 2012
  1. Suraj N. Kurapati
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 0 deletions.
  1. +4 −0 lib/arel/select_manager.rb
  2. +8 −0 test/test_select_manager.rb
4 lib/arel/select_manager.rb
View
@@ -141,6 +141,10 @@ def project *projections
self
end
+ def projections
+ @ctx.projections
+ end
+
def projections= projections
@ctx.projections = projections
end
8 test/test_select_manager.rb
View
@@ -1033,6 +1033,14 @@ def test_join_sources
end
end
+ describe 'projections' do
+ it 'reads projections' do
+ manager = Arel::SelectManager.new Table.engine
+ manager.project Arel.sql('foo'), Arel.sql('bar')
+ manager.projections.must_equal [Arel.sql('foo'), Arel.sql('bar')]
+ end
+ end
+
describe 'projections=' do
it 'overwrites projections' do
manager = Arel::SelectManager.new Table.engine
Something went wrong with that request. Please try again.