From 660f706491ac012cb133554cffeaa6b9ae6046e9 Mon Sep 17 00:00:00 2001 From: Arthur Taylor Date: Fri, 15 Apr 2011 16:34:18 +0200 Subject: Fixed deep copy bug in SelectManager clone --- test/test_select_manager.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') 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 -- cgit v1.2.3