diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-07 09:26:18 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-07 09:26:18 -0800 |
commit | 3cd905ee7b6ec8765cf9690b88ada5ae27fc3fd0 (patch) | |
tree | 0ada58ada98f9dd1ca43c8992924013cc33b7aaa /test/support | |
parent | 4d92a6b33476a5b324188bd86dfa5b5d3f4dcd3a (diff) | |
download | rails-3cd905ee7b6ec8765cf9690b88ada5ae27fc3fd0.tar.gz rails-3cd905ee7b6ec8765cf9690b88ada5ae27fc3fd0.tar.bz2 rails-3cd905ee7b6ec8765cf9690b88ada5ae27fc3fd0.zip |
use the cache mechanism in the connection pool rather than our own cache
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/fake_record.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/support/fake_record.rb b/test/support/fake_record.rb index 376ed40f2d..54f73489c9 100644 --- a/test/support/fake_record.rb +++ b/test/support/fake_record.rb @@ -3,7 +3,7 @@ module FakeRecord end class Connection - attr_reader :tables + attr_reader :tables, :columns_hash def initialize @tables = %w{ users photos developers } @@ -15,6 +15,9 @@ module FakeRecord Column.new('created_at', :date), ] } + @columns_hash = { + 'users' => Hash[@columns['users'].map { |x| [x.name, x] }] + } @primary_keys = { 'users' => 'id' } @@ -75,6 +78,14 @@ module FakeRecord def with_connection yield connection end + + def table_exists? name + connection.tables.include? name.to_s + end + + def columns_hash + connection.columns_hash + end end class Base |