Permalink
Browse files

Should clear the primary keys cache also

  • Loading branch information...
1 parent 7f20bb9 commit 7b1eeea5bc69747b5bfde2af2c7245339da2be74 @jonleighton jonleighton committed Dec 16, 2011
@@ -34,6 +34,7 @@ def table_exists?(name)
def clear!
@columns.clear
@columns_hash.clear
+ @primary_keys.clear
@tables.clear
end
@@ -26,14 +26,18 @@ def test_caches_columns_hash
assert_equal columns_hash, @cache.columns_hash['posts']
end
- def test_clearing_column_cache
+ def test_clearing
@cache.columns['posts']
@cache.columns_hash['posts']
+ @cache.tables['posts']
+ @cache.primary_keys['posts']
@cache.clear!
assert_equal 0, @cache.columns.size
assert_equal 0, @cache.columns_hash.size
+ assert_equal 0, @cache.tables.size
+ assert_equal 0, @cache.primary_keys.size
end
end
end

0 comments on commit 7b1eeea

Please sign in to comment.