On Mon, 21 May 2012 02:47:59 -0700 (PDT), kosfar <
dant...@gmail.com>
wrote:
If you are going to put cache in the model, ActiveScaffold will use
model methods to query, so you don't need to hack ActiveScaffold source.
Maybe you will have to read the code to know the methods used by
ActiveScaffold, although it use the usual methods in rails to query.
You should never modify ActiveScaffold source, you can override
controller methods defined by ActiveScaffold, and you can use super to
invoke ActiveScaffold method.
For example, overriding the do_list method:
def do_list
if cached
return cached
else
super
end
end
Also, maybe it works using cache_page or cache_action in the
controller:
http://guides.rubyonrails.org/caching_with_rails.html
Anyway, you shouldn't do premature optimization and cache at the
beginning, you should add caches when you find requests are slow.