From c5f9fbf0d66ddeaf1fb2992e696ffe88244bda82 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sat, 19 Nov 2011 18:57:36 -0800 Subject: calling cache methods against the connection --- test/support/fake_record.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'test/support') diff --git a/test/support/fake_record.rb b/test/support/fake_record.rb index ddef7b66c5..79182f86bd 100644 --- a/test/support/fake_record.rb +++ b/test/support/fake_record.rb @@ -3,9 +3,10 @@ module FakeRecord end class Connection - attr_reader :tables, :columns_hash, :visitor + attr_reader :tables, :columns_hash + attr_accessor :visitor - def initialize(visitor) + def initialize(visitor = nil) @tables = %w{ users photos developers products} @columns = { 'users' => [ @@ -50,6 +51,10 @@ module FakeRecord "\"#{name.to_s}\"" end + def schema_cache + self + end + def quote thing, column = nil if column && column.type == :integer return 'NULL' if thing.nil? @@ -79,7 +84,8 @@ module FakeRecord def initialize @spec = Spec.new(:adapter => 'america') - @connection = Connection.new(Arel::Visitors::ToSql.new(self)) + @connection = Connection.new + @connection.visitor = Arel::Visitors::ToSql.new(connection) end def with_connection @@ -93,6 +99,10 @@ module FakeRecord def columns_hash connection.columns_hash end + + def schema_cache + connection + end end class Base -- cgit v1.2.3