From 8eb0547d2ca3df3cdc127c5e437c84a4ea6ebf52 Mon Sep 17 00:00:00 2001
From: Domizio Demichelis
Date: Wed, 27 Oct 2010 17:15:36 -0400
Subject: [PATCH] fix for the too many query generated by too many
table_exists? calls [#836 state:resolved]
---
hobo/lib/hobo/model.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hobo/lib/hobo/model.rb b/hobo/lib/hobo/model.rb
index a66e34743..a0a0466ba 100644
--- a/hobo/lib/hobo/model.rb
+++ b/hobo/lib/hobo/model.rb
@@ -333,6 +333,11 @@ def view_hints
class_name.safe_constantize or Object.class_eval("class #{class_name} < Hobo::ViewHints; end; #{class_name}")
end
+ def table_exists?
+ @table_exists_cache = super if @table_exists_cache.nil?
+ @table_exists_cache
+ end
+
end # --- of ClassMethods --- #