Title: [opsview] [9603] Delete select from and delete from the same table.
- Revision
- 9603
- Author
- pknight
- Date
- 2012-07-20 17:50:40 +0100 (Fri, 20 Jul 2012)
Log Message
Delete select from and delete from the same table.
Modified Paths
Modified: trunk/opsview-core/lib/Opsview/ResultSet/Keywords.pm
===================================================================
--- trunk/opsview-core/lib/Opsview/ResultSet/Keywords.pm 2012-07-20 16:04:50 UTC (rev 9602)
+++ trunk/opsview-core/lib/Opsview/ResultSet/Keywords.pm 2012-07-20 16:50:40 UTC (rev 9603)
@@ -33,7 +33,8 @@
# Need to order by name in edit contacts page
sub retrieve_all { shift->search( {}, { order_by => "name" } ) }
-# This removes all the keywords from notification profiles, required otherwise a contact could have access left over
+# This removes all the keywords from notification profiles, required otherwise a
+# contact could have access left over
sub synchronise_intxn_post {
my ( $self, $object, $attrs ) = @_;
@@ -46,12 +47,14 @@
);
# Need to ignore roles that have all_keywords (tested in t/941keywords.t)
- $rs->search(
+ my @invalid_roles = $rs->search(
{
"role.id" => { -not_in => \@valid },
"role.all_keywords" => 0
}
- )->delete;
+ );
+ $_->delete for @invalid_roles;
+
}
1;
_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins