]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/RequirementSpecItem.pm
jQuery.hotkeys-Plugin hinzugefügt
[mfinanz.git] / SL / DB / RequirementSpecItem.pm
index 5e7d46c91cc200e9b992ea50b7e2e333e70f7604..49d9158459c67d0d31ebbe1a0d31953714c06107 100644 (file)
@@ -41,7 +41,7 @@ __PACKAGE__->configure_acts_as_list(group_by => [qw(requirement_spec_id parent_i
 __PACKAGE__->attr_duration(qw(time_estimation));
 
 __PACKAGE__->before_save(\&_before_save_create_fb_number);
-__PACKAGE__->before_save(\  &_before_save_invalidate_requirement_spec_version);
+__PACKAGE__->before_save(\&_before_save_invalidate_requirement_spec_version);
 __PACKAGE__->before_delete(\&_before_delete_invalidate_requirement_spec_version);
 
 sub _before_save_create_fb_number {
@@ -66,7 +66,7 @@ sub _before_save_create_fb_number {
 sub _before_save_invalidate_requirement_spec_version {
   my ($self, %params) = @_;
 
-  return 1 if !$self->requirement_spec_id;
+  return 1 if !$self->requirement_spec_id || $self->requirement_spec->working_copy_id;
 
   my %changed_columns = map { $_ => 1 } (Rose::DB::Object::Helpers::dirty_columns($self));
   my $has_changed     = !Rose::DB::Object::Util::is_in_db($self);
@@ -104,8 +104,7 @@ sub children_sorted {
 
   croak "Not a writer" if @args;
 
-  my @children = sort { $a->position <=> $b->position } $self->children;
-  return wantarray ? @children : \@children;
+  return [ sort { $a->position <=> $b->position } $self->children ];
 }
 
 sub section {
@@ -150,9 +149,8 @@ Returns the C<item_type> for children of C<$self>.
 
 =item C<children_sorted>
 
-Returns an array (or an array reference depending on context) of
-direct children (not of grandchildren) for C<$self> ordered by their
-positional column in ascending order.
+Returns an array reference of direct children (not of grandchildren)
+for C<$self> ordered by their positional column in ascending order.
 
 =item C<section>