Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: affc2e8674
Fetching contributors…

Cannot retrieve contributors at this time

file 25 lines (18 sloc) 0.517 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
package Angelos::ORM::DBIC::AutoStoreDateTime;
use strict;
use warnings;
use base 'DBIx::Class';

# steal from MoFedge::Data::DBIC::AutoStoreDataTime
sub insert {
    my $self = shift;

    $self->store_column( 'created_on', $self->datetime->now )
        if $self->result_source->has_column('created_on');

    $self->next::method(@_);
}

sub update {
    my $self = shift;

    $self->updated_on( $self->datetime->now )
        if $self->result_source->has_column('updated_on');

    $self->next::method(@_);
}

1;
Something went wrong with that request. Please try again.