Skip Menu |
 

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 27180
Status: resolved
Priority: 0/
Queue: DBIx-Class

People
Owner: claco [...] cpan.org
Requestors: GHENRY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.07006
Fixed in: (no value)



Subject: Inflate_column doesn't honour the accessor => key
Download (untitled) / with headers
text/plain 1.3k
Dear Devs, Inflate_column doesn't honour the accessor => key, for example: use strict; use warnings; use base 'DBIx::Class'; use DateTime::Format::Pg; __PACKAGE__->load_components(qw/ InflateColumn::DateTime Core /); __PACKAGE__->table('ftm_v_time'); __PACKAGE__->add_columns( qw/ timeid userid add_hours deduct_hours total_hours comments except_count activeind moduserid moddatetime / ); __PACKAGE__->add_columns( 'time_in[1]' => { data_type => 'datetime', accessor => 'time_in_one' }, 'time_in[2]' => { data_type => 'datetime', accessor => 'time_in_two' }, 'time_out[1]' => { data_type => 'datetime', accessor => 'time_out_one' }, 'time_out[2]' => { data_type => 'datetime', accessor => 'time_out_two' }, day => { data_type => 'datetime' }, ); for my $hours_col (qw/add_hours deduct_hours total_hours/) { __PACKAGE__->inflate_column( $hours_col, { inflate => sub { DateTime::Format::Pg->parse_interval(shift); }, deflate => sub { DateTime::Format::Pg->format_interval(shift); }, } ); } 1; The accessors; time_in_one, time_in_two etc. contain the original column value. I will look into this myself as soon as I can, but for now in TT I do: [% time_in_one = 'time_in[1]' %] and value="[% timesheet_input.${time_in_one} %]" Thanks for your time, Gavin.
Fixed in -current.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.