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

Report information
The Basics
Id:
53129
Status:
new
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
preaction [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
1.02
Fixed in:
(no value)

Attachments
dbic-virtualcolumns-fix-get_inflated_columns.patch.txt



Subject: Virtual Columns in relationships do not persist if modified in new() during create
 If you modify a virtual column in a relationship inside new() while you're creating a new row, the virtual columns will not survive DBIx::Class::Row->insert. 

DBIx::Class::Row->insert line 306 uses get_inflated_columns to get the data to create the new related row, which VirtualColumns does not implement.

I've attached a patch to implement get_inflated_columns, which fixes this problem.
Subject: dbic-virtualcolumns-fix-get_inflated_columns.patch.txt
--- VirtualColumns.pm.old 2009-12-27 16:26:32.000000000 -0600 +++ VirtualColumns.pm 2009-12-27 16:26:38.000000000 -0600 @@ -270,6 +270,17 @@ return %data; } +=head2 get_inflated_columns + +Overloaded method. L<DBIx::Class::Row/"get_inflated_columns"> + +=cut + +sub get_inflated_columns { + my $self = shift; + return ($self->next::method(@_), %{$self->{_virtual_values}}); +} + =head2 store_column Overloaded method. L<DBIx::Class::Row/"store_column">


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

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