diff --git a/Netdisco/lib/Netdisco/DB/Result/DevicePort.pm b/Netdisco/lib/Netdisco/DB/Result/DevicePort.pm index 27cdcd4b..7dac2286 100644 --- a/Netdisco/lib/Netdisco/DB/Result/DevicePort.pm +++ b/Netdisco/lib/Netdisco/DB/Result/DevicePort.pm @@ -288,4 +288,19 @@ sub is_free { return ($diff_sec >= $total ? 1 : 0); } +=head1 ADDITIONAL COLUMNS + +=head2 lastchange_stamp + +Formatted version of the C field, accurate to the minute. + +The format is somewhat like ISO 8601 or RFC3339 but without the middle C +between the date stamp and time stamp. That is: + + 2012-02-06 12:49 + +=cut + +sub lastchange_stamp { return (shift)->get_column('lastchange_stamp') } + 1; diff --git a/Netdisco/lib/Netdisco/DB/ResultSet/Device.pm b/Netdisco/lib/Netdisco/DB/ResultSet/Device.pm index fa49bea1..0248c912 100644 --- a/Netdisco/lib/Netdisco/DB/ResultSet/Device.pm +++ b/Netdisco/lib/Netdisco/DB/ResultSet/Device.pm @@ -197,7 +197,7 @@ The following fields are inspected for a match: sub search_fuzzy { my ($rs, $q) = @_; - die "missing param to search_by_field\n" + die "missing param to search_fuzzy\n" unless $q; $q = "\%$q\%" if $q !~ m/\%/; diff --git a/Netdisco/views/ajax/device/ports.tt b/Netdisco/views/ajax/device/ports.tt index 30c9e1ef..31b92b56 100644 --- a/Netdisco/views/ajax/device/ports.tt +++ b/Netdisco/views/ajax/device/ports.tt @@ -41,7 +41,7 @@ [% END %] [% IF params.c_lastchange %] - [% row.get_column('lastchange_stamp') | html_entity %] + [% row.lastchange_stamp | html_entity %] [% END %] [% IF params.c_name %] [% row.name | html_entity %]