I am working on a support tool. I have two models, one called Service
and another called Issues. A service may have many issues. I then
output tables showing what services have what issues. When creating
the tables i only need partial data out of the Service and Issues
tables. So in other words for each service i want to preload the
issues, but only the data i need to use. Otherwise the include takes
over 20 seconds to load. If i could specify which columns to preload,
it would only load a tenth of the data. Will the rails framework
force me to break up the issues table into two? Does anyone have a
solution?
1) use find_by_sql and roll your own query that pulls just what you
need for the report.
2) create a view in the database that selects a subset of columns from
issues, and then define an AR model over that view that you can
associate to services.
tables. So in other words for each service i want to preload the
issues, but only the data i need to use. Otherwise the include takes
over 20 seconds to load. If i could specify which columns to preload,
it would only load a tenth of the data. Will the rails framework
force me to break up the issues table into two? Does anyone have a
solution?