use strict;
use warnings;
+use DBIx::Class::ResultClass::HashRefInflator;
use base qw/DBIx::Class::Core/;
### Define what our admin class is, for ensure_class_loaded()
sub inflate_result {
my $self = shift;
my $ret = $self->next::method(@_);
+
if ( $ret->admin ) { ### If this is an admin, rebless for extra functions
$self->ensure_class_loaded($admin_class);
bless $ret, $admin_class;
use lib qw(t/lib);
use DBICTest;
+use DBIx::Class::ResultClass::HashRefInflator;
use Test::More;
)
);
+my $rs = $schema->resultset('User');
+
TODO: {
local $TODO = 'New objects should also be inflated';
- my $user = $schema->resultset('User')->create($user_data);
- my $admin = $schema->resultset('User')->create($admin_data);
+ my $user = $rs->create($user_data);
+ my $admin = $rs->create($admin_data);
is( ref $user, 'My::Schema::Result::User' );
is( ref $admin, 'My::Schema::Result::User::Admin' );