X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema.pm;h=6fca48e5431d8bda0ef73ec5245e9d5300a66a34;hb=6864429af43e4ab081343157784d5e00dca7200d;hp=0d49b4bcbcf19084a6f2fbca6c0ca055469cfd9d;hpb=44e95db4537a7ace8aee44bcf74b8b9d79c03b6b;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 0d49b4b..6fca48e 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -618,8 +618,7 @@ Retrieves the Result class name for the given source name. =cut sub class { - my ($self, $source_name) = @_; - return $self->source($source_name)->result_class; + return shift->source(shift)->result_class; } =head2 txn_do @@ -770,15 +769,10 @@ those values. sub populate { my ($self, $name, $data) = @_; - if(my $rs = $self->resultset($name)) { - if(defined wantarray) { - return $rs->populate($data); - } else { - $rs->populate($data); - } - } else { - $self->throw_exception("$name is not a resultset"); - } + my $rs = $self->resultset($name) + or $self->throw_exception("'$name' is not a resultset"); + + return $rs->populate($data); } =head2 connection