code-and-effect/effective_datatables — pull request #1 by jfeaver (2014-12-11 23:47:55+00:00)
Title: first attempt at caching the collection

I noticed while testing the collection in effective email templates that the collection method gets called a lot which means a lot of database calls. This is an attempt to cache the collection. Unfortunately, I couldn't run tests as the gemspec does not include the proper gem dependencies and there are a number of other errors that pop up with a fresh gem bundle.

I don't know that creating a class level instance variable here is the correct usage here. Since it is a class level method, there might be issues with all datatables using the same collection. I remember seeing something like a `SimpleCache` in `ActionView`. We could probably find a cache that we could drop in to the `_collection` method.