X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FBase.pm;h=7cd3214646f3b9e5d9bdd29215e27dd112252369;hb=d047d650648a9566e84ca994cf699eebaf0cd156;hp=8f02598b764411bd37ee8c720206f49c945c929c;hpb=164efde326393118b39eed56843d41b45b0cad83;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index 8f02598..7cd3214 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -83,18 +83,18 @@ command immediately before C. An arrayref containing a list of accessors in the foreign class to create in the main class. If, for example, you do the following: - + MyDB::Schema::CD->might_have(liner_notes => 'MyDB::Schema::LinerNotes', undef, { proxy => [ qw/notes/ ], }); - + Then, assuming MyDB::Schema::LinerNotes has an accessor named notes, you can do: my $cd = MyDB::Schema::CD->find(1); $cd->notes('Notes go here'); # set notes -- LinerNotes object is # created if it doesn't exist - + =item accessor Specifies the type of accessor that should be created for the relationship. @@ -179,7 +179,7 @@ sub related_resultset { my $rel_info = $self->relationship_info($rel); $self->throw_exception( "No such relationship ${rel}" ) unless $rel_info; - + return $self->{related_resultsets}{$rel} ||= do { my $attrs = (@_ > 1 && ref $_[$#_] eq 'HASH' ? pop(@_) : {}); $attrs = { %{$rel_info->{attrs} || {}}, %$attrs };