From a10e65f883a64f8c74e4125b977ec52255c8e63e Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 24 Mar 2010 10:25:29 -0700 Subject: [PATCH] Use Moose method modifiers for overriding addRev in Story. --- lib/WebGUI/Asset/Story.pm | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/WebGUI/Asset/Story.pm b/lib/WebGUI/Asset/Story.pm index 989f28201..a0e07aa56 100644 --- a/lib/WebGUI/Asset/Story.pm +++ b/lib/WebGUI/Asset/Story.pm @@ -117,23 +117,16 @@ Request autocommit. =cut -sub addRevision { +around addRevision => sub { + my $orig = shift; my $self = shift; - my $session = $self->session; - my $newSelf = $self->next::method(@_); - - my $newProperties = { - isHidden => 1, - }; - - $newSelf->update($newProperties); + my $newSelf = $self->$orig(@_); my $newPhotoData = $newSelf->duplicatePhotoData; $newSelf->setPhotoData($newPhotoData); - #$newSelf->requestAutoCommit; return $newSelf; -} +}; #-------------------------------------------------------------------