package State;
use base 'DBIx::Class';
+State->load_components(qw/CDBICompat Core/);
State->table('State');
State->columns(Essential => qw/Abbreviation Name/);
package City;
use base 'DBIx::Class';
+City->load_components(qw/CDBICompat Core/);
City->table('City');
City->columns(All => qw/Name State Population/);
#-------------------------------------------------------------------------
package CD;
use base 'DBIx::Class';
+CD->load_components(qw/CDBICompat Core/);
CD->table('CD');
CD->columns('All' => qw/artist title length/);
my @grps = sort State->__grouper->groups_for(State->_find_columns(qw/rain capital/));
is @grps, 2, "Rain and Capital = 2 groups";
- @grps = sort @grps; # Because DBIx::Class is hash-based
+ @grps = sort @grps; # Because the underlying API is hash-based
is $grps[0], 'Other', " - Other";
is $grps[1], 'Weather', " - Weather";
}
-SKIP: {
+{
+ package DieTest;
+ @DieTest::ISA = qw(DBIx::Class);
+ DieTest->load_components(qw/CDBICompat::Retrieve Core/);
+ package main;
local $SIG{__WARN__} = sub { };
- eval { DBIx::Class->retrieve(1) };
- like $@, qr/Can't retrieve unless primary columns are defined/, "Need primary key for retrieve";
+ eval { DieTest->retrieve(1) };
+ like $@, qr/unless primary columns are defined/, "Need primary key for retrieve";
}
#-----------------------------------------------------------------------
package A;
@A::ISA = qw(DBIx::Class);
+__PACKAGE__->load_components(qw/CDBICompat Core/);
__PACKAGE__->columns(Primary => 'id');
package A::B;