From: Peter Rabbitson Date: Wed, 14 Apr 2010 15:50:56 +0000 (+0000) Subject: Fix exception message X-Git-Tag: v0.08122~116 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7ded7437c1327ace28562a27bc0b0019d1a0596;p=dbsrgits%2FDBIx-Class.git Fix exception message --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index f9784d0..06f850b 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -106,10 +106,10 @@ with NULL as the default, and save yourself a SELECT. sub __new_related_find_or_new_helper { my ($self, $relname, $data) = @_; + my $rsrc = $self->result_source; + # create a mock-object so all new/set_column component overrides will run: - my $rel_rs = $self->result_source - ->related_source($relname) - ->resultset; + my $rel_rs = $rsrc->related_source($relname)->resultset; my $new_rel_obj = $rel_rs->new_result($data); my $proc_data = { $new_rel_obj->get_columns }; @@ -117,7 +117,7 @@ sub __new_related_find_or_new_helper { MULTICREATE_DEBUG and warn "MC $self constructing $relname via new_result"; return $new_rel_obj; } - elsif ($self->result_source->_pk_depends_on($relname, $proc_data )) { + elsif ($rsrc->_pk_depends_on($relname, $proc_data )) { if (! keys %$proc_data) { # there is nothing to search for - blind create MULTICREATE_DEBUG and warn "MC $self constructing default-insert $relname"; @@ -132,7 +132,7 @@ sub __new_related_find_or_new_helper { return $new_rel_obj; } else { - my $us = $self->source_name; + my $us = $rsrc->source_name; $self->throw_exception ("'$us' neither depends nor is depended on by '$relname', something is wrong..."); } }