From 79411322ae225289e1c051f4f68ed84c6349e4a0 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Mon, 8 Aug 2011 23:23:51 +0100 Subject: Make it the responsibility of the connection to hold on to a visitor for generating SQL, rather than the TreeManager. (There is a related commit coming in Active Record.) --- test/support/fake_record.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/support') diff --git a/test/support/fake_record.rb b/test/support/fake_record.rb index babf5fa25b..ddef7b66c5 100644 --- a/test/support/fake_record.rb +++ b/test/support/fake_record.rb @@ -3,9 +3,9 @@ module FakeRecord end class Connection - attr_reader :tables, :columns_hash + attr_reader :tables, :columns_hash, :visitor - def initialize + def initialize(visitor) @tables = %w{ users photos developers products} @columns = { 'users' => [ @@ -27,6 +27,7 @@ module FakeRecord 'users' => 'id', 'products' => 'id' } + @visitor = visitor end def primary_key name @@ -78,7 +79,7 @@ module FakeRecord def initialize @spec = Spec.new(:adapter => 'america') - @connection = Connection.new + @connection = Connection.new(Arel::Visitors::ToSql.new(self)) end def with_connection -- cgit v1.2.3