aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/fake_record.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-27 13:12:15 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-27 13:12:15 -0700
commit77fa5fa5f7cc21824edb5b1c1ebccd58f92e982b (patch)
tree80c71416e19948b7e0c4c3b9aacd36672ab62d1d /spec/support/fake_record.rb
parentec998ae9a6aeda09ad64bb94a50ac8b9fccd246d (diff)
downloadrails-77fa5fa5f7cc21824edb5b1c1ebccd58f92e982b.tar.gz
rails-77fa5fa5f7cc21824edb5b1c1ebccd58f92e982b.tar.bz2
rails-77fa5fa5f7cc21824edb5b1c1ebccd58f92e982b.zip
to_sql on nodes may be passed an engine
Diffstat (limited to 'spec/support/fake_record.rb')
-rw-r--r--spec/support/fake_record.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/support/fake_record.rb b/spec/support/fake_record.rb
index 2aba0c10f2..30c49f2b16 100644
--- a/spec/support/fake_record.rb
+++ b/spec/support/fake_record.rb
@@ -63,14 +63,11 @@ module FakeRecord
class Spec < Struct.new(:config)
end
- attr_reader :spec
+ attr_reader :spec, :connection
def initialize
@spec = Spec.new('sqlite3')
- end
-
- def connection
- Connection.new
+ @connection = Connection.new
end
def with_connection
@@ -79,11 +76,13 @@ module FakeRecord
end
class Base
- def self.connection_pool
- ConnectionPool.new
+ attr_accessor :connection_pool
+
+ def initialize
+ @connection_pool = ConnectionPool.new
end
- def self.connection
+ def connection
connection_pool.connection
end
end