+ if ( $updates->{id} ){
+ $object = $self->find( $updates->{id}, { key => 'primary' } );
+ }
+ my @missing =
+ grep { !exists $updates->{$_} && !exists $fixed_fields{$_} } $self->result_source->primary_columns;
+ if ( !$object && !scalar @missing ) {
+ $object = $self->find( $updates, { key => 'primary' } );
+ }
+ @missing =
+ grep { !exists $resolved->{$_} } @missing;
+ if ( !$object && !scalar @missing ) {
+ $object = $self->find( \%{ %$updates, %$resolved }, { key => 'primary' } );
+ }
+ $object ||= $self->new( {} );