Project

General

Profile

Feature #186 ยป 0001-report-lookup-change.patch

change Host.reports.last to Host.find(host.id).reports.maximun('id') - Telmo X, 03/22/2010 04:17 PM

View differences:

app/controllers/hosts_controller.rb
# shows the last report for a host
def report
# is it safe to assume that the biggest ID is the last report?
redirect_to :controller => "reports", :action => "show", :id => Host.find(params[:id]).reports.last
redirect_to :controller => "reports", :action => "show", :id => Report.find(Host.find(params[:id]).reports.maximum('id'))
end
# shows all reports for a certian host
app/helpers/hosts_helper.rb
return nil if record.last_report.nil?
time = time_ago_in_words(record.last_report.getlocal)
image_tag("#{not (record.error_count > 0 or record.no_report)}.png", :size => "18x18") +
link_to_if(record.reports.last, time, report_host_path(record))
link_to_if(Report.find(Host.find(record.id).reports.maximum('id')), time, report_host_path(record))
end
def root_pass_form_column(record, field_name)
vendor/plugins/active_scaffold
Subproject commit 7c5a3e9ec9ae8432a2190cd2ef741cb78d605f35
vendor/plugins/active_scaffold_list_filter
Subproject commit 4356ed54ca78ba1c68a1e626ea4e8bd73b515fa4
vendor/plugins/acts_as_audited
Subproject commit a150a7d1502e16de878c60bbac4c821d7960b8e8
vendor/plugins/ruby-net-ldap
Subproject commit ba08042d75ae930578a96846ae7180e8bf450846
vendor/plugins/will_paginate
Subproject commit 3d531e169db92a16a9a8974f0ae6edf52e52659e
vendor/rails
Subproject commit bfe032858077bb2946abe25e95e485ba6da86bd5
    (1-1/1)