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 List::Util qw( any ); |
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 |
for my $key ( keys %{$original_value} ) { |
285 |
die "value passed for unrecognised column: $key" |
286 |
if !( any { $key eq $_ } @columns ); |
287 |
} |
288 |
|
283 |
my $build_value = 5; |
289 |
my $build_value = 5; |
284 |
# we try max $build_value times if there are unique constraints |
290 |
# we try max $build_value times if there are unique constraints |
285 |
BUILD_VALUE: while ( $build_value ) { |
291 |
BUILD_VALUE: while ( $build_value ) { |
286 |
- |
|
|