Proper Moose setup for addRevision...

This commit is contained in:
Colin Kuskie 2010-04-06 16:13:02 -07:00
parent 64f7bd9365
commit dee5bbe5d0
8 changed files with 58 additions and 120 deletions

View file

@ -178,9 +178,9 @@ Override the default method in order to deal with attachments.
=cut
sub addRevision {
override addRevision => sub {
my $self = shift;
my $newSelf = $self->SUPER::addRevision(@_);
my $newSelf = super();
if ($newSelf->getRevisionCount > 1) {
foreach my $field (qw(image1 image2 image3 brochure manual warranty)) {
if ($self->get($field)) {
@ -190,7 +190,7 @@ sub addRevision {
}
}
return $newSelf;
}
};
#-------------------------------------------------------------------