$object = $self->find( $updates, { key => 'primary' } );
}
- $object = $self->new( {} )
+ $object = $self->new_result( {} )
unless defined $object;
# warn Dumper( $updates ); use Data::Dumper;
$if_not_submitted );
}
- # $self->_delete_empty_auto_increment($object);
+ _delete_empty_auto_increment($object);
# don't allow insert to recurse to related objects
# do the recursion ourselves
# $object->{_rel_in_storage} = 1;
if ( $rclass->can('_m2m_metadata') ) {
return $rclass->_m2m_metadata->{$relation};
}
- my $object = $self->new( {} );
+ my $object = $self->new_result( {} );
if ( $object->can($relation)
and !$self->result_source->has_relationship($relation)
and $object->can( 'set_' . $relation ) )
->related_source(
$rclass->_m2m_metadata->{$relation}{foreign_relation} );
}
- my $object = $self->new( {} );
+ my $object = $self->new_result( {} );
my $r = $object->$relation;
return $r->result_source;
}
sub _delete_empty_auto_increment {
- my ( $self, $object ) = @_;
+ my ( $object ) = @_;
for my $col ( keys %{ $object->{_column_data} } ) {
if ($object->result_source->column_info($col)->{is_auto_increment}
and ( !defined $object->{_column_data}{$col}