[Dbix-class] Possible error in DBIx::Class::TimeStamp

Oleg Kostyuk cub.uanic at gmail.com
Fri Aug 7 08:55:21 GMT 2009


2009/8/6 Wallace Reis <reis.wallace at gmail.com>:
> On Fri, Jul 31, 2009 at 2:33 PM, Oleg Kostyuk<cub.uanic at gmail.com> wrote:
>
> Hmm. It seems to be right, except that I'm not sure if
> dynamic_default_*on_create* should depend of set_*on_update*.
>

As for me, this is obviously: if you have both fields, and
dynamic_default_on_update configured, and dynamic_default_on_create
exists but not configured, then it will be configured by TimeStamp
too. I just tried to leave original code untouched as much possible.
Probably, this code will be more correct:

=====  cut =====
      if ( delete $info->{set_on_update} ) {
          $info->{dynamic_default_on_update} = 'get_timestamp';
          unless ( exists($info->{dynamic_default_on_create})
                  and defined($info->{dynamic_default_on_create})
           ) {
              $info->{dynamic_default_on_create} = 'get_timestamp';
          }
      }
=====  cut =====

Thanks for your attention.

-- 
Sincerely yours,
Oleg Kostyuk (CUB-UANIC)



More information about the DBIx-Class mailing list