Lines 12-17
use Bytes::Random::Secure;
Link Here
|
12 |
use Carp qw( carp ); |
12 |
use Carp qw( carp ); |
13 |
use Module::Load qw( load ); |
13 |
use Module::Load qw( load ); |
14 |
use String::Random; |
14 |
use String::Random; |
|
|
15 |
use Array::Utils qw( array_minus ); |
15 |
|
16 |
|
16 |
use constant { |
17 |
use constant { |
17 |
SIZE_BARCODE => 20, # Not perfect but avoid to fetch the value when creating a new item |
18 |
SIZE_BARCODE => 20, # Not perfect but avoid to fetch the value when creating a new item |
Lines 280-285
sub _buildColumnValues {
Link Here
|
280 |
my @columns = $self->schema->source($source)->columns; |
281 |
my @columns = $self->schema->source($source)->columns; |
281 |
my %unique_constraints = $self->schema->source($source)->unique_constraints(); |
282 |
my %unique_constraints = $self->schema->source($source)->unique_constraints(); |
282 |
|
283 |
|
|
|
284 |
my @passed_keys = grep { ref($original_value->{$_}) ne 'HASH' } keys %$original_value; |
285 |
my @minus = array_minus( @passed_keys, @columns ); |
286 |
die "Error: value hash contains unrecognized columns: ". (join ',', @minus) if @minus; |
287 |
|
283 |
my $build_value = 5; |
288 |
my $build_value = 5; |
284 |
# we try max $build_value times if there are unique constraints |
289 |
# we try max $build_value times if there are unique constraints |
285 |
BUILD_VALUE: while ( $build_value ) { |
290 |
BUILD_VALUE: while ( $build_value ) { |
286 |
- |
|
|