« Tapper/Schema/TestrunDB/Result/ReportgroupArbitrary.pm
↑ Summary
auto/Tapper/Schema/Tapper-Schema-TestrunDB-4.001040-2-MySQL.pl »
| 1 | package Tapper::Schema::TestrunDB::Result::ScenarioElement; | ||||||||||
| 2 | 10 | our $AUTHORITY = 'cpan:TAPPER'; | |||||||||
| 3 | 10 | $Tapper::Schema::TestrunDB::Result::ScenarioElement::VERSION = '5.0.12'; | |||||||||
| 4 | # ABSTRACT: Tapper - Containing relations between scenarios and testrun_ids | ||||||||||
| 5 | |||||||||||
| 6 | 10 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 10 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 10 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 10 | ▶ | use parent 'DBIx::Class'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 10 | __PACKAGE__->load_components("InflateColumn::Object::Enum", "Core"); | |||||||||
| 13 | 10 | __PACKAGE__->table("scenario_element"); | |||||||||
| 14 | 10 | __PACKAGE__->add_columns | |||||||||
| 15 | ( | ||||||||||
| 16 | "id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_auto_increment => 1, }, | ||||||||||
| 17 | "testrun_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_foreign_key => 1, }, | ||||||||||
| 18 | "scenario_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_foreign_key => 1, }, | ||||||||||
| 19 | "is_fitted", { data_type => "INT", default_value => 0, is_nullable => 0, size => 1, }, | ||||||||||
| 20 | ); | ||||||||||
| 21 | |||||||||||
| 22 | 10 | __PACKAGE__->set_primary_key(qw/id/); | |||||||||
| 23 | |||||||||||
| 24 | 10 | (my $basepkg = __PACKAGE__) =~ s/::\w+$//; | |||||||||
| 25 | |||||||||||
| 26 | 10 | __PACKAGE__->belongs_to( testrun => "${basepkg}::Testrun", { 'foreign.id' => 'self.testrun_id' }); | |||||||||
| 27 | 10 | __PACKAGE__->belongs_to( scenario => "${basepkg}::Scenario", { 'foreign.id' => 'self.scenario_id' }); | |||||||||
| 28 | 10 | __PACKAGE__->has_many ( peer_elements => "${basepkg}::ScenarioElement", { 'foreign.scenario_id' => 'self.scenario_id' }); | |||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | sub peers_need_fitting | ||||||||||
| 32 | 0 | ▶ | { | ||||||||
|
Subroutine
peers_need_fitting: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 33 | 0 | my ($self) = @_; | |||||||||
| 34 | 0 | ▶ | return 0 if $self->scenario->type ne 'interdep'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 0 | return $self->peer_elements->search({is_fitted => { '!=' => 1,}})->count; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 10 | 1; | |||||||||
| 39 | |||||||||||
| 40 | __END__ | ||||||||||