typos are loading an entire table

Hello all,

When I have a syntax error accessing my model's index action the server shows an SQL call to load an all of that model. Since there are 700k+ entries, this always causes a crash.

This ONLY happens the app goes into error catching mode.

I have traced the query to using this method https://github.com/ntalbott/query_trace and have the following:

https://gist.github.com/959097

So here is what I found out. On the error page under the "Show env dump" link it is inspecting the variables passed to the templates, one of which is an Alarm.search(nil) [Meta search] object. This is where all of these entries are being loaded from.

How can I prevent the debug page from loading these associations?

Brian