diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-08-11 08:43:21 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-08-11 21:47:30 +0100 |
commit | 88c91f7cdbe904c0a215a05be76ae120eacb24fb (patch) | |
tree | ec4567e3c5ee28cadf93319fd3e04daf9b18fcbb /test | |
parent | 160917526a8d038d4fbb4d90635e26a9df8d8871 (diff) | |
download | rails-88c91f7cdbe904c0a215a05be76ae120eacb24fb.tar.gz rails-88c91f7cdbe904c0a215a05be76ae120eacb24fb.tar.bz2 rails-88c91f7cdbe904c0a215a05be76ae120eacb24fb.zip |
Add SelectManager#projections= method to overwrite projections
Diffstat (limited to 'test')
-rw-r--r-- | test/test_select_manager.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb index 3d43ecfc11..ada0f1423d 100644 --- a/test/test_select_manager.rb +++ b/test/test_select_manager.rb @@ -860,6 +860,15 @@ module Arel end end + describe 'projections=' do + it 'overwrites projections' do + manager = Arel::SelectManager.new Table.engine + manager.project Arel.sql('foo') + manager.projections = [Arel.sql('bar')] + manager.to_sql.must_be_like %{ SELECT bar } + end + end + describe 'take' do it "knows take" do table = Table.new :users |