[Dbix-class] Default values
stephen joseph butler
stephen.butler at gmail.com
Mon Apr 30 22:14:55 GMT 2007
On 4/30/07, Dan Boger <dan at peeron.com> wrote:
> The error I'm seeing:
>
> apocalypse$ prove -v t/Peeron2/ActivityLog.t
> t/Peeron2/ActivityLog....ok 1 - Old log test entries not found
> Can't use string ("Peeron2::Schema::ActivityLog") as a HASH ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.8.5/DBIx/Class/Row.pm line 97.
> 1..1
> # Looks like your test died just after 1.
...
> sub new {
> my ($self, $attrs) = @_;
>
> $attrs->{unixtime} = time if not $attrs->{unixtime} or $attrs->{unixtime} =~ /\D/;
> $attrs->{date} = sprintf("%04d-%02d-%02d", (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3])
> unless $attrs->{date} and $attrs->{date} =~ /^\d\d\d\d-\d\d-\d\d$/;
>
> $self->next::method($attrs);
>
> return $self;
> }
Either $self = $self->next::method( $attrs ), or remove your return
(thus returning the last value of next::method).
More information about the Dbix-class
mailing list