aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_select_manager.rb
diff options
context:
space:
mode:
authorArthur Taylor <arthur@aupeo.com>2011-04-15 22:34:18 +0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-04-19 00:22:12 +0800
commita318d6f5a7695bae85e7da67f423e86e164344b3 (patch)
treefc0846b2a10c674a8f694d5bcdd4abee2e8035a3 /test/test_select_manager.rb
parent3e3d4d197943d6fc30976021a0f125ba8eab1dd1 (diff)
downloadrails-a318d6f5a7695bae85e7da67f423e86e164344b3.tar.gz
rails-a318d6f5a7695bae85e7da67f423e86e164344b3.tar.bz2
rails-a318d6f5a7695bae85e7da67f423e86e164344b3.zip
Fixed deep copy bug in SelectManager clone
Diffstat (limited to 'test/test_select_manager.rb')
-rw-r--r--test/test_select_manager.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb
index 81a32e4490..955d8e8d3a 100644
--- a/test/test_select_manager.rb
+++ b/test/test_select_manager.rb
@@ -187,6 +187,16 @@ module Arel
m2.project "foo"
mgr.to_sql.wont_equal m2.to_sql
end
+
+ it 'makes updates to the correct copy' do
+ table = Table.new :users, :engine => Table.engine, :as => 'foo'
+ mgr = table.from table
+ m2 = mgr.clone
+ m3 = m2.clone
+ m2.project "foo"
+ mgr.to_sql.wont_equal m2.to_sql
+ m3.to_sql.must_equal mgr.to_sql
+ end
end
describe 'initialize' do