[Catalyst-commits] r14526 - CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Mon May 12 20:20:09 GMT 2014
Author: karpet
Date: 2014-05-12 20:20:09 +0000 (Mon, 12 May 2014)
New Revision: 14526
Modified:
CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller/REST.pm
Log:
controller does not know anything about related objects so delegate to the object to get PK
Modified: CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller/REST.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller/REST.pm 2014-05-12 19:46:52 UTC (rev 14525)
+++ CatalystX-CRUD/CatalystX-CRUD-Controller-REST/trunk/lib/CatalystX/CRUD/Controller/REST.pm 2014-05-12 20:20:09 UTC (rev 14526)
@@ -354,7 +354,10 @@
my $rel_obj
= $self->do_model( $c, 'create_related', $c->stash->{object}, $rel, );
if ($rel_obj) {
- my $rel_id = $self->make_primary_key_string($rel_obj);
+
+ # this controller doesn't know anything about the PK for $rel,
+ # so assume the object can give us a PK.
+ my $rel_id = $rel_obj->primary_key_uri_escaped;
$self->status_created(
$c,
location =>
More information about the Catalyst-commits
mailing list