Forum: Ruby on Rails Preloading models in Rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A591b75d465d8366bbd161c437f6f3af?d=identicon&s=25 Richard (Guest)
on 2006-05-16 18:06
Hi,

I'm fairly new to rails and I need some advice on best practice. I'm
working on an application that has a calendar section (I know, not
another one of those!) and I was wondering, when is it best to query
your database and when is it best to preload a model. In the calendar
app the user will have a month view of entries and was wondering should
I preload all the entries of the month or should I just query the
database whenever the user wants something. I want to preload but I'm
not sure whether it is worth it considering I'm only envisaging a couple
thousand users.

And one more thing, are preloaded models held in the database or on
file.

Thanks in advance,
Richard
This topic is locked and can not be replied to.