fixes #186 - When reports are kept in the database and not deleted/purged the Host.reports.last query starts slowing down and the hosts index page can take minutes to load depending on the number of hosts. By changing Host.reports.last to Host.find(host.id).reports.maximum('id') we make a more efficient query to the database cutting the lookup time.
Related issues
Feature #186: UI Slows down when reports are not purged form DB.
fixes #186 - When reports are kept in the database and not deleted/purged the Host.reports.last query starts slowing down and the hosts index page can take minutes to load depending on the number of hosts. By changing Host.reports.last to Host.find(host.id).reports.maximum('id') we make a more efficient query to the database cutting the lookup time.