Changeset 29750

Show
Ignore:
Timestamp:
02/09/09 14:20:55 (4 years ago)
Author:
yappo
Message:

added to add_method of schema

Location:
lang/perl/Data-Model/trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Data-Model/trunk/lib/Data/Model/Schema.pm

    r29591 r29750  
    2020    no strict 'refs'; 
    2121    for my $name (qw/ base_driver driver install_model schema column columns key index unique schema_options column_sugar 
    22         utf8_column utf8_columns alias_column /) { 
     22        utf8_column utf8_columns alias_column add_method /) { 
    2323        *{"$caller\::$name"} = \&$name; 
    2424    } 
     
    251251} 
    252252 
     253sub add_method { 
     254    my($name, $schema) = _get_model_schema; 
     255    my($method, $code) = @_; 
     256    no strict 'refs'; 
     257    *{$schema->class."::$method"} = $code; 
     258} 
     259 
    253260 
    254261sub column_sugar (@) {