提交 7b1eeea5 编写于 作者: J Jon Leighton

Should clear the primary keys cache also

上级 7f20bb99
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册