Proper Moose setup for addRevision...
This commit is contained in:
parent
64f7bd9365
commit
dee5bbe5d0
8 changed files with 58 additions and 120 deletions
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue