Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6395006f

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

AttrDuration: in SL::DB::Object->assign_attributes() auch attr_man_days_string() vor _unit() auswerten

Unterschiede anzeigen:

SL/DB/Object.pm
60 60

  
61 61
  my %types      = map { $_->name => $_->type } ref($self)->meta->columns;
62 62

  
63
  # Special case for *_as_man_days/*_as_man_days_unit: the _unit
64
  # variation must always be called after the non-unit method.
65
  my @man_days_attributes = grep { m/_as_man_days$/ } keys %attributes;
63
  # Special case for *_as_man_days / *_as_man_days_string /
64
  # *_as_man_days_unit: the _unit variation must always be called
65
  # after the non-unit methods.
66
  my @man_days_attributes = grep { m/_as_man_days(?:_string)?$/ } keys %attributes;
66 67
  foreach my $attribute (@man_days_attributes) {
67 68
    my $value = delete $attributes{$attribute};
68 69
    $self->$attribute(defined($value) && ($value eq '') ? undef : $value);

Auch abrufbar als: Unified diff