[Bast-commits] r6152 - in
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk:
lib/DBIx/Class/ResultSet t/var
zby at dev.catalyst.perl.org
zby at dev.catalyst.perl.org
Wed May 6 19:12:20 GMT 2009
Author: zby
Date: 2009-05-06 19:12:19 +0000 (Wed, 06 May 2009)
New Revision: 6152
Modified:
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/var/dvdzbr.db
Log:
using non-column, non-relation methods
Modified: DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm
===================================================================
--- DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm 2009-05-06 16:33:58 UTC (rev 6151)
+++ DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm 2009-05-06 19:12:19 UTC (rev 6152)
@@ -40,6 +40,7 @@
# relations that that should be done after the row is inserted into the database
# like has_many and might_have
my %post_updates;
+ my %other_methods;
my %columns_by_accessor = _get_columns_by_accessor( $self );
for my $name ( keys %$updates ) {
@@ -51,6 +52,9 @@
$columns{$name} = $updates->{$name};
next;
}
+ if( !( $source->has_relationship($name) && ref( $updates->{$name} ) ) ){
+ $other_methods{$name} = $updates->{$name};
+ }
next if !$source->has_relationship($name);
my $info = $source->relationship_info($name);
if (
@@ -78,6 +82,9 @@
for my $name ( keys %columns ) {
$object->$name( $updates->{$name} );
}
+ for my $name ( keys %other_methods) {
+ $object->$name( $updates->{$name} ) if $object->can( $name );
+ }
for my $name ( keys %pre_updates ) {
my $info = $object->result_source->relationship_info($name);
_update_relation( $self, $name, $updates, $object, $info );
Modified: DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/var/dvdzbr.db
===================================================================
(Binary files differ)
More information about the Bast-commits
mailing list