diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-16 10:38:20 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-09-16 10:38:20 -0300 |
commit | 016bce4ef10eac48fab44205dcf7961e5b0bc094 (patch) | |
tree | 12f140e8dcece55f591591f6da95d15b17db0780 /test | |
parent | d23df0ec8a50b50024f8d4dc5d91a47509df9b1f (diff) | |
parent | 8c73dad0761980061ce45018172034cad34cd585 (diff) | |
download | rails-016bce4ef10eac48fab44205dcf7961e5b0bc094.tar.gz rails-016bce4ef10eac48fab44205dcf7961e5b0bc094.tar.bz2 rails-016bce4ef10eac48fab44205dcf7961e5b0bc094.zip |
Merge pull request #311 from tamird/master
`Extract#as` should not mutate the receiver
Diffstat (limited to 'test')
-rw-r--r-- | test/nodes/test_extract.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/nodes/test_extract.rb b/test/nodes/test_extract.rb index 80bb465f24..eb98553268 100644 --- a/test/nodes/test_extract.rb +++ b/test/nodes/test_extract.rb @@ -15,6 +15,14 @@ describe Arel::Nodes::Extract do EXTRACT(DATE FROM "users"."timestamp") AS foo } end + + it 'should not mutate the extract' do + table = Arel::Table.new :users + extract = table[:timestamp].extract('date') + before = extract.dup + extract.as('foo') + assert_equal extract, before + end end describe 'equality' do |