aboutsummaryrefslogtreecommitdiffstats
path: root/test/support
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-08-08 23:23:51 +0100
committerJon Leighton <j@jonathanleighton.com>2011-08-08 23:23:51 +0100
commit79411322ae225289e1c051f4f68ed84c6349e4a0 (patch)
tree424499366dc9c7ced8a271756b86a865ce17c977 /test/support
parent03b6ca269ac8dfec8f70f2b98439d45b873f9e97 (diff)
downloadrails-79411322ae225289e1c051f4f68ed84c6349e4a0.tar.gz
rails-79411322ae225289e1c051f4f68ed84c6349e4a0.tar.bz2
rails-79411322ae225289e1c051f4f68ed84c6349e4a0.zip
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.)
Diffstat (limited to 'test/support')
-rw-r--r--test/support/fake_record.rb7
1 files changed, 4 insertions, 3 deletions
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