Ignore:
Timestamp:
05/19/12 11:38:41 (12 years ago)
Author:
nanardon
Message:
  • fix attributes object return in some, simplify code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Objects.pm

    r965 r1002  
    132132sub attribute { 
    133133    my ($self, $attribute) = @_; 
     134 
     135    my $attrinfo; 
     136    if (! ref $attribute) { 
     137        $attrinfo = $self->base->get_attr_schema( 
     138            $self->type, $attribute 
     139        ) or return; 
     140        $attrinfo->{name} = $attribute; 
     141    } else { 
     142        $attrinfo = $attribute; 
     143    } 
     144 
    134145    return LATMOS::Accounts::Bases::Attributes->new( 
    135         $attribute, 
     146        $attrinfo, 
    136147        $self, 
    137148    ); 
Note: See TracChangeset for help on using the changeset viewer.