projects
/
dbsrgits/DBIx-Class.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
7b0fc1b
)
more informative error in related_source when relationship doesn't exist
Will Hawes [Thu, 26 Jan 2006 13:03:16 +0000 (13:03 +0000)]
lib/DBIx/Class/ResultSource.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/DBIx/Class/ResultSource.pm
b/lib/DBIx/Class/ResultSource.pm
index
4a78664
..
789aeda
100644
(file)
--- a/
lib/DBIx/Class/ResultSource.pm
+++ b/
lib/DBIx/Class/ResultSource.pm
@@
-414,6
+414,9
@@
Returns the result source for the given relationship
sub related_source {
my ($self, $rel) = @_;
+ if( !$self->has_relationship( $rel ) ) {
+ croak "No such relationship '$rel'";
+ }
return $self->schema->source($self->relationship_info($rel)->{source});
}