table_exists? repeatedly queries the DB
Reported by Matt Jones | March 4th, 2010 @ 03:47 PM | in Hobo 1.1
The fix in f5b76ea65e52da7c8dcfbeea21fa3a6b2ed0af9d for creating STI parents and children in one migration calls table_exists? - which apparently isn't cached for the SQLite adapater, at least.
Comments and changes to this ticket
-
Matt Jones March 4th, 2010 @ 03:47 PM
- Assigned user set to Matt Jones
- Milestone set to Hobo 1.1
-
Bryan Larsen April 1st, 2010 @ 03:42 PM
from discussion http://www.mail-archive.com/hobousers@googlegroups.com/msg05384.html
Matt wrote:
I'm pretty slammed today, but I think all this needs is to change line 211 of model_extensions.rb from:
return unless table_exists?
to:
return unless (@table_exists ||= table_exists?)
(one @ since we're already in a class context) This has the additional bonus of working OK in the migration case, since we'll always check to see if the table is there until it actually is. One would presume that a production environment wouldn't likely run with missing tables...
-
Bryan Larsen April 2nd, 2010 @ 03:49 PM
- State changed from new to resolved
(from [e8ad92b2d264cf4c4f0fe3e179f51845d6f8d86f]) [#659 state:resolved] table_exists? repeatedly queries the DB http://github.com/tablatom/hobo/commit/e8ad92b2d264cf4c4f0fe3e179f5...
-
Bryan Larsen April 17th, 2010 @ 07:15 PM
(from [8ab161dffadf26991c582648197d18e2162ede04]) [#659 state:resolved] table_exists? repeatedly queries the DB http://github.com/tablatom/hobo/commit/8ab161dffadf26991c582648197d...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
People watching this ticket
Tags
Referenced by
- 659 table_exists? repeatedly queries the DB (from [8ab161dffadf26991c582648197d18e2162ede04]) [#659 s...
- 84 Why does reflection.klass hit the database? (SHOW TABLES) - need a fix/workaround duplicate of #659
- 659 table_exists? repeatedly queries the DB (from [e8ad92b2d264cf4c4f0fe3e179f51845d6f8d86f]) [#659 s...