Show
Ignore:
Timestamp:
10/29/08 14:15:07 (5 years ago)
Author:
kamipo
Message:

lang/perl/DBIx-Class-TimeStamp?-Auto: deleted unnecessity create method hook

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/DBIx-Class-TimeStamp-Auto/lib/DBIx/Class/TimeStamp/Auto.pm

    r21707 r22312  
    11package DBIx::Class::TimeStamp::Auto; 
    2  
    32use strict; 
    43use warnings; 
     
    3433__PACKAGE__->mk_classdata(timestamp_class => 'DBIx::Class::TimeStamp::Auto'); 
    3534 
    36 before create => sub { 
    37     my ($self, $attrs) = @_; 
    38  
    39     return if ref $attrs ne 'HASH'; 
    40  
    41     my $now; 
    42     my $timestamp_class = $self->timestamp_class; 
    43  
    44     for ( 
    45         @{$timestamp_class->auto_create_datetime_columns}, 
    46         @{$timestamp_class->auto_update_datetime_columns} 
    47     ) { 
    48         $attrs->{$_} = $now ||= $timestamp_class->get_current_datetime 
    49             if !defined $attrs->{$_} and $self->is_inflate_datetime_column($_); 
    50     } 
    51 }; 
    52  
    5335before update => sub { 
    5436    my ($self, $attrs) = @_; 
     
    5941    my $timestamp_class = $self->timestamp_class; 
    6042 
    61     for ( 
    62         @{$timestamp_class->auto_update_datetime_columns} 
    63     ) { 
     43    for (@{$timestamp_class->auto_update_datetime_columns}) { 
    6444        $attrs->{$_} = $now ||= $timestamp_class->get_current_datetime 
    6545            if !defined $attrs->{$_} and $self->is_inflate_datetime_column($_);