« lib/Reaction/InterfaceModel/Reflector/SearchSpec.pm
↑ Summary
lib/Reaction/InterfaceModel/Search/UpdateSpec.pm »
| 1 | package Reaction::InterfaceModel::Action::DBIC::ResultSet::Create; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use Reaction::Types::DBIC 'ResultSet'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use Reaction::Class; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use Reaction::InterfaceModel::Action; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Reaction::InterfaceModel::Action::DBIC::Role::CheckUniques; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 5 | ▶ | use namespace::clean -except => [ qw(meta) ]; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 5 | extends 'Reaction::InterfaceModel::Action::DBIC::ResultSet'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 5 | with 'Reaction::InterfaceModel::Action::DBIC::Role::CheckUniques'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub do_apply { | ||||||||||||||||||||||||||
|
Subroutine
do_apply: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||
| 14 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 15 | 0 | my $args = $self->parameter_hashref; | |||||||||||||||||||||||||||
| 16 | 0 | my $new = $self->target_model->new({}); | |||||||||||||||||||||||||||
| 17 | 0 | my @delay; | |||||||||||||||||||||||||||
| 18 | 0 | foreach my $name (keys %$args) { | |||||||||||||||||||||||||||
| 19 | 0 | ▶ | my $tm_attr = $new->meta->find_attribute_by_name($name) or next; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | 0 | my $tm_writer = $tm_attr->get_write_method; | |||||||||||||||||||||||||||
| 21 | 0 | ▶ | unless ($tm_writer) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | 0 | warn "Unable to find writer for ${name}"; | |||||||||||||||||||||||||||
| 23 | 0 | next; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | 0 | ▶ | if ($tm_attr->type_constraint->name eq 'ArrayRef' | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$tm_attr->type_constraint->name eq "ArrayRef" or $tm_attr->type_constraint->is_subtype_of("ArrayRef")
MC/DC0%0/2
$tm_attr->type_constraint->name eq "ArrayRef" or $tm_attr->type_constraint->is_subtype_of("ArrayRef")
$tm_attr->type_constraint->name eq "ArrayRef"
$tm_attr->type_constraint->is_subtype_of("ArrayRef")
Truth table0%0/3
A or B
A= $tm_attr->type_constraint->name eq "ArrayRef"B= $tm_attr->type_constraint->is_subtype_of("ArrayRef")
| |||||||||||||||||||||||||||||
| 26 | || $tm_attr->type_constraint->is_subtype_of('ArrayRef')) { | ||||||||||||||||||||||||||||
| 27 | 0 | push(@delay, [ $tm_writer, $args->{$name} ]); | |||||||||||||||||||||||||||
| 28 | } else { | ||||||||||||||||||||||||||||
| 29 | 0 | $new->$tm_writer($args->{$name}); | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | 0 | $new->insert; | |||||||||||||||||||||||||||
| 33 | 0 | foreach my $d (@delay) { | |||||||||||||||||||||||||||
| 34 | 0 | my ($meth, $val) = @$d; | |||||||||||||||||||||||||||
| 35 | 0 | $new->$meth($val); | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | 0 | return $new; | |||||||||||||||||||||||||||
| 38 | }; | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 5 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 5 | 1; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | __END__; | ||||||||||||||||||||||||||||